08 September 2021

Change the netconnection type to Private in the registry - Unable to find the netconnection

This one is quite common:

One of the network connection types on this machine is set to Public.

When trying to setup PSremoting you could run in to this error.


And when trying to find the connection that is marked as public you can't find it.

Chances are that your not connected to that connection at the moment, but the connection is there.
You can find all the connections that are configured on you machine in the registry:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles

There you will find all the GUID's with all the connection profiles in it. The value we are looking for is  "Category" DWORD. It will look like this:


Where the value of the "Category" DWORD means:

0 = Domain
1 = Private
2 = Public

So just set all "Category" DWORD's to value 1, reboot and your Enable-PSRemoting command should work.

If that doesn't work you could just run:

Enable-PSRemoting -SkipNetworkProfileCheck -Force

And if all else fails force all connections (in case of an Hyper-V server installation on your WIndows 10/11 box) to be set to "Private":

$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")) 
$connections = $networkListManager.GetNetworkConnections() 

# Set network location to Private for all networks 
$connections | % {$_.GetNetwork().SetCategory(1)}

No comments:

Post a Comment