Last active
June 1, 2018 09:59
-
-
Save giseongeom/9aa7e7b419a36cbb04fa03d8861241a9 to your computer and use it in GitHub Desktop.
Enable WinRM HTTPS Listener on Windows Server 2016
This file contains hidden or 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
| #Requires -version 5 | |
| #Requires -RunAsAdministrator | |
| # Add firewall rule | |
| New-NetFirewallRule -DisplayName WINRM-HTTPS-In-TCP ` | |
| -Name WINRM-HTTPS-In-TCP -Enabled True -Protocol TCP ` | |
| -Profile Any -Direction Inbound -RemoteAddress Any ` | |
| -LocalPort 5986 | |
| # Cert | |
| $computer = Get-ComputerInfo | |
| $newselfcert = New-SelfSignedCertificate ` | |
| -DnsName $computer.CsDNSHostName ` | |
| -CertStoreLocation Cert:\LocalMachine\My | |
| # Enable HTTPS Listener | |
| New-Item -Path WSMan:\Localhost\Listener ` | |
| -Transport HTTPS -Address * ` | |
| -CertificateThumbprint $newselfcert.Thumbprint -Force | |
| # (Optional) Disable LocalAccountTokenFilterPolicy | |
| # Use with care | |
| New-ItemProperty -Name LocalAccountTokenFilterPolicy ` | |
| -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System ` | |
| -PropertyType DWord -Value 1 -Force | |
| # Check Configuration | |
| & WinRM e winrm/config/listener |
Author
giseongeom
commented
Jun 1, 2018
- 참고자료
- How to configure WinRM for HTTPS manually
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment