Created
November 11, 2016 23:33
-
-
Save gregjhogan/dbe0bfa277d450c049e0bbdac6142eed to your computer and use it in GitHub Desktop.
Configure WinRM HTTPS w/ self-signed certificate
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
# configure | |
$cert = New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName $env:COMPUTERNAME | |
Enable-PSRemoting -SkipNetworkProfileCheck -Force | |
New-Item -Path WSMan:\LocalHost\Listener -Transport HTTPS -Address * -CertificateThumbPrint $cert.Thumbprint –Force | |
New-NetFirewallRule -DisplayName "Windows Remote Management (HTTPS-In)" -Name "Windows Remote Management (HTTPS-In)" -Profile Any -LocalPort 5986 -Protocol TCP | |
# connect | |
Enter-PSSession -ComputerName {X.X.X.X} -Credential (Get-Credential) -SessionOption (New-PsSessionOption -SkipCACheck -SkipCNCheck) -UseSSL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment