Guest User

Untitled

a guest
Oct 19th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. Set-Item wsman:localhostClientTrustedHosts -value *
  2.  
  3. $username = 'jason'
  4. $pass = ConvertTo-SecureString -string 'Password' -AsPlainText -Force
  5. $cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $pass
  6. $s = New-PSSession -ConnectionUri 'http://13.xx.xx.89:5985' -Credential $cred -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck)
  7. Invoke-Command -Session $s -ScriptBlock {get-process}
Add Comment
Please, Sign In to add comment