Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

up vote 3 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 at 11:06

Your Answer

 
discard

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.