Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. $username = "administrator"
  2. $password = "your-super-secret-password"
  3. $securePassword = ConvertTo-SecureString $password -AsPlainText -Force
  4. $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $securePassword
  5.  
  6. $pstimeout = New-PSSessionoption -OperationTimeout (1000*60*5)
  7. $session = New-PSSession -computer $ipAddress -Credential $cred -ErrorAction Stop -SessionOption $pstimeout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement