Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 6 down vote accepted
  1. Open a PowerShell window with administrative privileges.
  2. Run dir WSMan:\localhost\listener\*\Port and check the Value parameter to see what you're currently listening on.
  3. 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"}'
share|improve this answer
You might need to restart the WinRM service afterwards for the change to take effect. +1 – Ryan Ries Apr 30 '12 at 16:41
Thank you this worked. – zespri Apr 30 '12 at 21:59
does "Set-Item" has any advantage over "winrm set"? – Talespin_Kit Feb 21 '14 at 11:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.