Difference between revisions of "Winrm enable https 5986"

From UVOO Tech Wiki
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
# Steps
 +
 +
## Copy Cert
 +
copy cert called myhost.example.com and import pkcs12 pfx on host
 +
 +
 +
## enable winrm https port 5986
 
```
 
```
 
$HN="myhost.example.com";
 
$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
 
$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
 +
```
 +
 +
## Connect
 
```
 
```
 +
enter-pssession -usessl myhost.example.com
 +
```
 +
 +
# Another Way
 +
```
 +
Set-WSManInstance -ResourceURI winrm/config/Listener -SelectorSet @{Address="*"; Transport="HTTPS"} -ValueSet @{CertificateThumbprint='xxxxx';Hostname='myhost.example.com'}
 +
```
 +
 +
 +
# More
  
May not work
+
Notes of stuff that seems to not work
 
```
 
```
 
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
 
```
 
```

Latest revision as of 18:26, 17 January 2024

Steps

Copy Cert

copy cert called myhost.example.com and import pkcs12 pfx on host

enable winrm https port 5986

$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

Connect

enter-pssession -usessl myhost.example.com

Another Way

Set-WSManInstance -ResourceURI winrm/config/Listener -SelectorSet @{Address="*"; Transport="HTTPS"} -ValueSet @{CertificateThumbprint='xxxxx';Hostname='myhost.example.com'}

More

Notes of stuff that seems to not work

winrm quickconfig -transport:https -force
New-NetFirewallRule -DisplayName "ALLOW WinRM HTTPS 5986" -Direction inbound -Profile Any -Action Allow -LocalPort 5986 -Protocol TCP