QuickTip - One-liners to get WinRM port numbers
With PowerShell 2.0 the default Windows Remote Management (WinRM) port numbers has changed from 80/443 (HTTP/HTTPS) to 5985/5986. One reason for changing the ports was a collision with internet servers which used the same ports. These ports are configured when you enable remoting in PowerShell 2.0, typically by using the Enable-PSRemoting cmdlet.
So, if you need a quick reminder about the port numbers WinRM uses for its listeners…
PS > Get-ChildItem WSMan:\localhost\Service\DefaultPorts | Format-Table -AutoSize Name,Value
Name Value
---- -----
HTTP 5985
HTTPS 5986
PS > Get-ChildItem WSMan:\localhost\Client\DefaultPorts | Format-Table -AutoSize Name,Value
Name Value
---- -----
HTTP 5985
HTTPS 5986
Note: To run these commands in Windows Vista, Windows Server 2008, and later versions of Windows, you must start Windows PowerShell with the "Run as administrator" option.