Test the transport first
From the client, run Test-WSMan servername. If it fails, investigate WinRM service state, listeners, DNS and firewall before changing credentials.
Check the listener
On the target server, review WinRM listeners with winrm enumerate winrm/config/listener. Confirm that the expected HTTP or HTTPS listener exists.
Check the firewall
Verify that the required WinRM traffic is permitted. Test TCP connectivity separately with Test-NetConnection servername -Port 5985 or the configured HTTPS port.
Check authentication
In a domain environment, use the expected domain identity and validate Kerberos dependencies. Workgroup or cross-domain scenarios may require additional TrustedHosts or certificate configuration.
Check permissions
Run PowerShell elevated when changing WS-Man configuration. Confirm that the account has the required local or delegated permissions on the destination.
Retest with a minimal command
After correcting one dependency, test a simple command such as Invoke-Command -ComputerName servername -ScriptBlock { hostname } before returning to the larger automation.
Useful commands
Test-WSMan servername
winrm enumerate winrm/config/listener
Test-NetConnection servername -Port 5985
Invoke-Command -ComputerName servername -ScriptBlock { hostname }Need more infrastructure runbooks?
Explore the TechRunbook article library for Windows Server, VMware, Hyper-V, Azure, PowerShell and MABS troubleshooting.
Browse all articles →