Difference between revisions of "Winrm enable https 5986"
Jump to navigation
Jump to search
Line 3: | Line 3: | ||
$TP=(Get-ChildItem -Path Cert:LocalMachine\MY | where Subject -like "CN=${HN}*").Thumbprint | $TP=(Get-ChildItem -Path Cert:LocalMachine\MY | where Subject -like "CN=${HN}*").Thumbprint | ||
winrm create winrm/config/Listener?Address=*+Transport=HTTPS "@{Hostname=`"${HN}`"; CertificateThumbprint=`"$TP`"}" | winrm create winrm/config/Listener?Address=*+Transport=HTTPS "@{Hostname=`"${HN}`"; CertificateThumbprint=`"$TP`"}" | ||
+ | New-NetFirewallRule -DisplayName "ALLOW WinRM HTTPS 5986" -Direction inbound -Profile Any -Action Allow -LocalPort 5986 -Protocol TCP | ||
``` | ``` | ||
Line 8: | Line 9: | ||
``` | ``` | ||
winrm quickconfig -transport:https -force | winrm quickconfig -transport:https -force | ||
+ | New-NetFirewallRule -DisplayName "ALLOW WinRM HTTPS 5986" -Direction inbound -Profile Any -Action Allow -LocalPort 5986 -Protocol TCP | ||
+ | ``` | ||
+ | |||
+ | |||
+ | |||
+ | ``` | ||
+ | enter-pssession -usessl myhost.example.com | ||
``` | ``` |
Revision as of 01:30, 7 November 2023
$HN="myhost.example.com"; $TP=(Get-ChildItem -Path Cert:LocalMachine\MY | where Subject -like "CN=${HN}*").Thumbprint winrm create winrm/config/Listener?Address=*+Transport=HTTPS "@{Hostname=`"${HN}`"; CertificateThumbprint=`"$TP`"}" New-NetFirewallRule -DisplayName "ALLOW WinRM HTTPS 5986" -Direction inbound -Profile Any -Action Allow -LocalPort 5986 -Protocol TCP
May not work
winrm quickconfig -transport:https -force New-NetFirewallRule -DisplayName "ALLOW WinRM HTTPS 5986" -Direction inbound -Profile Any -Action Allow -LocalPort 5986 -Protocol TCP
enter-pssession -usessl myhost.example.com