< return

WinRM HTTPS Setup

Cert generation via powershell for WinRM HTTPS

Powershell:

Set-ExecutionPolicy RemoteSigned

$fqdn = "yourmachinename.domain.com"

##enable winrm
winrm quickconfig

#get thumbprint
$thumbprint = (New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname $fqdn).Thumbprint

#create cert
Write-Host fqdn: $fqdn, thumbprint: $thumbprint
$cmd = 'winrm create winrm/config/listener?Address=*+Transport=HTTPS `@`{Hostname=`"$fqdn`"`; CertificateThumbprint=`"$thumbprint`"`}'

Invoke-Expression $cmd

netsh advfirewall firewall add rule name="winRM HTTPS" dir=in action=allow protocol=TCP localport=5986

gitHub

login