Difference between revisions of "Winrm enable https 5986"

From UVOO Tech Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
```
 
```
 +
$HN="myhost.example.com";
 
winrm delete winrm/config/Listener?Address=*+Transport=HTTPS
 
winrm delete winrm/config/Listener?Address=*+Transport=HTTPS
$HN="myhost.example.com";
 
 
$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`"}"

Revision as of 02:19, 7 November 2023

$HN="myhost.example.com";
winrm delete winrm/config/Listener?Address=*+Transport=HTTPS
$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

Connedt

enter-pssession -usessl myhost.example.com