Created
July 12, 2013 00:03
-
-
Save wbingli/5980348 to your computer and use it in GitHub Desktop.
Windows: Import certificate and configure WinRM HTTPS and IIS HTTPS bindings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Question, is the last two step necessary?