Skip to content

Instantly share code, notes, and snippets.

@wbingli
Created July 12, 2013 00:03
Show Gist options
  • Save wbingli/5980348 to your computer and use it in GitHub Desktop.
Save wbingli/5980348 to your computer and use it in GitHub Desktop.
Windows: Import certificate and configure WinRM HTTPS and IIS HTTPS bindings
REM Check certificates
certutil -store MY
REM Import cert
certutil -p PASSWORD -ImportPFX CERT_PATH
REM Check winrm listners
winrm e winrm/config/listener
REM delete if it exists
winrm delete winrm/config/listener?Address=*+Transport=HTTPS
REM Add WINRM HTTPS using imported certificate
winrm create winrm/config/Listener?Address=*+Transport=HTTPS @{Hostname="YOUR_DOMAIN_NAME";CertificateThumbprint="THUMBPRINT_OF_IMPORTED_CERT"}
REM Delete HTTPS SSL cert binding
netsh http delete sslcert ipport=0.0.0.0:443
REM Add HTTPS SSL cert binding
netsh http add sslcert ipport=0.0.0.0:443 certstorename=MY certhash=THUMBPRINT_OF_IMPORTED_CERT appid={4dc3e181-e14b-4a21-b022-59fc669b0914}
@Shuliyey
Copy link

Question, is the last two step necessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment