Advertisement
Guest User

Untitled

a guest
Apr 6th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. Param(
  2. [Parameter(Mandatory=$true)]
  3. [string]$IP,
  4. [string]$User="Administrator",
  5. [string]$Password="P@ssw0rd"
  6. )
  7.  
  8. $ErrorActionPreference = "Stop"
  9.  
  10. $secPassword = ConvertTo-SecureString -asPlainText -Force $Password
  11. $c = New-Object System.Management.Automation.PSCredential($User, $secPassword)
  12.  
  13. $opt = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck
  14. $session = New-PSSession -ComputerName $IP -UseSSL -SessionOption $opt -Authentication Basic -Credential $c
  15. Enter-PSSession $session
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement