Setting up PowerShell Remoting using winrm quickconfig or Enable-PSRemoting fails

A common problem on laptops or mobile workstations is that the initial PowerShell Remoting configuration will fail because the system is connected to a public network. The advice is to change the network from public to private, unfortunately this is not always possible because of WiFi connections.

There is a work around available for this, by running the following code:

Enable-PSRemoting -SkipNetworkProfileCheck -Force

By including the -SkipNetworkProfileCheck the cmdlet with omit the network check and PowerShell remoting correctly regardless of the fact that the system might be connected to a public network.

When setting up PowerShell Remoting using winrm quickconfig the following error might occur:

PS C:\WINDOWS\system32> winrm quickconfig  quests on this machine.
The following changes must be made:

Start the WinRM service.
Set the WinRM service type to delayed auto start.

Make these changes [y/n]? y

WinRM has been updated to receive requests.

WinRM service type changed successfully.
WinRM service started.
WSManFault
Message
ProviderFault
WSManFault
Message = WinRM firewall exception will not work since one of the network connection types on this machi
ne is set to Public. Change the network connection type to either Domain or Private and try again.

Error number: -2144108183 0x80338169
WinRM firewall exception will not work since one of the network connection types on this machine is set to Public. Chang
e the network connection type to either Domain or Private and try again.

Or when using Enable-PSRemoting without skip network check this error will appear:

PS C:\WINDOWS\system32> Enable-PSRemoting -force

Set-WSManQuickConfig : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2150859113"
Machine="localhost"><f:Message><f:ProviderFault provider="Config provider"
path="%systemroot%\system32\WsmSvc.dll"><f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault"
Code="2150859113" Machine="computername"><f:Message>WinRM firewall exception will not work since one of the network
connection types on this machine is set to Public. Change the network connection type to either Domain or Private and
try again. </f:Message></f:WSManFault></f:ProviderFault></f:Message></f:WSManFault>
At line:69 char:17
+ Set-WSManQuickConfig -force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Set-WSManQuickConfig], InvalidOperationException
+ FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.SetWSManQuickConfigCommand
Share

3 thoughts on “Setting up PowerShell Remoting using winrm quickconfig or Enable-PSRemoting fails

  1. Jesse Wolfe

    you need to supply a dash before SkipNetworkProfileCheck.Very helpful post, thanks.

    Reply
  2. AD

    any security implications with this method?
    would it not be better to change the network from Public to Private in the local security policy (secpol.msc)?

    Reply
    1. Jaap Brasser Post author

      Setting your WiFi network to private is alright if you never use public hotspots otherwise it might pose a security risk. As for the risk of enabling PowerShell remoting in this way, it depends what you configure as TrustedHosts on your system.

      Reply

Leave a Reply