QuickTip – One-liners to get WinRM port numbers

January 19, 2010

no comments

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.

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*