Hi,
here are the steps to reset WinRM service and start from scratch.
Start a cmd.exe shell with Administrator permissions. Stop and disable the service. Delete any config also settings applied by policy.
1 2 3 4 | D:\> sc stop winrmD:\> sc config winrm start=disabledD:\> reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN /fD:\> reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\winrm /f |
Restore the basic config
1 | D:\> winrm invoke Restore http://schemas.microsoft.com/wbem/wsman/1/config @{} |
And enable again. Enable-PSRemoting does a lot of things:
– QuickConfig
– enable session configuration
– create session endpoints
– create listeners
– adjusts the firewall config
– alters the security descriptors to allow remote access
– enable and restart the service
1 2 | D:\> sc config winrm start=autoD:\> powershell -command "& { Enable-PSRemoting }" |
Enable HTTPS Listener
Certificate thumbprint can be the computer certificate. To determine an existing use powershell:
1 2 3 4 5 6 | PS D:> dir Cert:\LocalMachine\my\* PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\myThumbprint Subject---------- -------1123345EA3EFBBBF9EE1032DD33B36EB98 CN=myHostName.myDomain.org |
1 | D:\> winrm create winrm/config/Listener?Address=*+Transport=HTTPS @{Hostname="myHostName.myDomain.org";CertificateThumbprint="1123345EA3EFBBBF9EE1032DD33B36EB98"} |
To remove the http listener when only want to use HTTPS
1 | D:\> winrm delete winrm/config/Listener?Address=*+Transport=HTTP |
…and re-add
1 | D:\> winrm create winrm/config/Listener?Address=*+Transport=HTTP |
Check config
1 2 | D:\> winrm get winrm/configwinrm enumerate winrm/config/listener |
Michael
Thank you