• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Changing WinRM service/server port

  • Thread starter Marco Shaw [MVP]
  • Start date
M

Marco Shaw [MVP]

#1
Anyone know how to change the server/service port?

I've created a listener, but I think I need to change the WinRM client
and server to use the new port...

PS C:\> Set-WSManInstance -ResourceURI
winrm/config/service/DefaultPorts -Value @{HTTP="6000"}
Set-WSManInstance : The WinRM client cannot process the request
because it is trying to update a read-only setting. Rem
ove this setting from the command and try again.
At line:1 char:18
+ Set-WSManInstance <<<< -ResourceURI
winrm/config/service/DefaultPorts -Value @{HTTP="6000"}
+ CategoryInfo : InvalidOperation: (:)
[Set-WSManInstance], InvalidOperationException
+ FullyQualifiedErrorId :
WsManError,Microsoft.WSMan.Management.SetWSManInstanceCommand
 

My Computer

B

Bob Landau

#2
Marco,

The settings you are trying to change are global which is another way of
saying assuming you can change these any scripts you give us using powershell
remoting would break and visa versa.

How are you making the remote call?

Either

Invoke-Command -Computer X -Port 6000 ...

or

Invoke-Command -ConnectionURI http://X:6000 ...

should work. I've yet to try this out but this is on my short list but I
don't want to experiement on my main machine so need to create a VM for
testing.


"Marco Shaw [MVP]" wrote:

> Anyone know how to change the server/service port?
>
> I've created a listener, but I think I need to change the WinRM client
> and server to use the new port...
>
> PS C:\> Set-WSManInstance -ResourceURI
> winrm/config/service/DefaultPorts -Value @{HTTP="6000"}
> Set-WSManInstance : The WinRM client cannot process the request
> because it is trying to update a read-only setting. Rem
> ove this setting from the command and try again.
> At line:1 char:18
> + Set-WSManInstance <<<< -ResourceURI
> winrm/config/service/DefaultPorts -Value @{HTTP="6000"}
> + CategoryInfo : InvalidOperation: (:)
> [Set-WSManInstance], InvalidOperationException
> + FullyQualifiedErrorId :
> WsManError,Microsoft.WSMan.Management.SetWSManInstanceCommand
> .
>
 

My Computer

B

Bob Landau

#3
don't forget about the firewall

http://support.microsoft.com/default.aspx/kb/947709

"Bob Landau" wrote:

> Marco,
>
> The settings you are trying to change are global which is another way of
> saying assuming you can change these any scripts you give us using powershell
> remoting would break and visa versa.
>
> How are you making the remote call?
>
> Either
>
> Invoke-Command -Computer X -Port 6000 ...
>
> or
>
> Invoke-Command -ConnectionURI http://X:6000 ...
>
> should work. I've yet to try this out but this is on my short list but I
> don't want to experiement on my main machine so need to create a VM for
> testing.
>
>
> "Marco Shaw [MVP]" wrote:
>

> > Anyone know how to change the server/service port?
> >
> > I've created a listener, but I think I need to change the WinRM client
> > and server to use the new port...
> >
> > PS C:\> Set-WSManInstance -ResourceURI
> > winrm/config/service/DefaultPorts -Value @{HTTP="6000"}
> > Set-WSManInstance : The WinRM client cannot process the request
> > because it is trying to update a read-only setting. Rem
> > ove this setting from the command and try again.
> > At line:1 char:18
> > + Set-WSManInstance <<<< -ResourceURI
> > winrm/config/service/DefaultPorts -Value @{HTTP="6000"}
> > + CategoryInfo : InvalidOperation: (:)
> > [Set-WSManInstance], InvalidOperationException
> > + FullyQualifiedErrorId :
> > WsManError,Microsoft.WSMan.Management.SetWSManInstanceCommand
> > .
> >
 

My Computer

M

Marco Shaw [MVP]

#4
New-PsSession supports a Port parameter, which likely allows one to override
the default WinRM settings *or*, you can edit the WinRM client itself to use
a different port to match the server-side...

Marco

"Bob Landau" <BobLandau@newsgroup> wrote in message
news:E1168E8A-3C61-4E87-A848-0688DD90C27A@newsgroup

> Marco,
>
> The settings you are trying to change are global which is another way of
> saying assuming you can change these any scripts you give us using
> powershell
> remoting would break and visa versa.
>
> How are you making the remote call?
 

My Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)