Last active
December 7, 2016 02:27
-
-
Save marckean/1143ab0cad0e7a11476734b1b3229610 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#To connect | |
$ServerName = "ServerName.cloudapp.net" | |
$port = '5986' | |
#region creds | |
$adminname = 'user.name' | |
$adminpassword = 'paasword' | |
#endregion | |
$password = ConvertTo-SecureString $adminpassword -AsPlainText -Force | |
$cred= New-Object System.Management.Automation.PSCredential (".\$adminname", $password) | |
### Enter session | |
$SessionOptions = New-PSSessionOption –SkipCACheck –SkipCNCheck –SkipRevocationCheck | |
Enter-PSSession -ComputerName $ServerName -Port $port -UseSSL -Credential $cred -SessionOption $SessionOptions | |
#Do Stuff... | |
#To disconnect | |
Exit-PSSession |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment