How do I change Listener port in Powershell/winrm 2.0?
22,795
- Open a PowerShell window with administrative privileges.
- Run
dir WSMan:\localhost\listener\*\Port
and check the Value parameter to see what you're currently listening on. - If you'd like to change it, run
Set-Item WSMan:\localhost\listener\*\Port 8888
If you'd still like to do it with winrm
, you need to modify your command to the following --
winrm set winrm/config/Listener?Address=*+Transport=HTTP '@{Port="8888"}'
Related videos on Youtube
Author by
Andrew Savinykh
Updated on September 18, 2022Comments
-
Andrew Savinykh over 1 year
In quite a few places the command for changing the port winrm listens on look like this:
winrm set winrm/config/Listener?Address=*+Transport=HTTP @{Port="8888"}
However this does not work for me. The error I'm getting is:
Error: Invalid use of command line. Type "winrm -?" for help.
Obviously, internet can't be wrong, so that's me doing something incorrectly. The question is, how to do this correctly?
-
Ryan Ries about 12 yearsYou might need to restart the WinRM service afterwards for the change to take effect. +1
-
Talespin_Kit about 10 yearsdoes "Set-Item" has any advantage over "winrm set"?
-
wandersick over 4 yearsI believe this Microsoft blog post would supplement this answer nicely by adding more alternatives and client-side configuration blogs.technet.microsoft.com/christwe/2012/06/20/…