Ugh…. What a headache. I attempted to enable Powershell remoting on my workstation this morning in order to test out some deployment scripts I have ideas for. Unfortunately while doing this I received the below 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.
At line:50 char:33
+ Set-WSManQuickConfig <<<< -force
+ CategoryInfo : InvalidOperation: (:) [Set-WSManQuickConfig], InvalidOperationException
+ FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.SetWSManQuickConfigCommand
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.
At line:50 char:33+ Set-WSManQuickConfig <<<< -force + CategoryInfo : InvalidOperation:
(:) [Set-WSManQuickConfig], InvalidOperationException + FullyQualifiedErrorId :
WsManError,Microsoft.WSMan.Management.SetWSManQuickConfigCommand
It appears that the VMWare Workstation NICs that get added to your system take on the public network profile. One would think this would be easy to fix…. load up control panel->network-> and make the switch. It is that easy unless you are on a domain. When you are on a domain the option is not available to you. After some digging I found this article that discusses how to change these settings using a COM object through Powershell, but the script does a check to ensure that the computer is not on the domain before it makes the change. I decided to go head first and try it out on the non-domain connected NICs, and I found that it worked like a charm.
Here is the script that will change all public profile NICs to become Work Network NICs:
$nlm = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
$connections = $nlm.getnetworkconnections()
$connections |foreach {
if ($_.getnetwork().getcategory() -eq 0)
{
$_.getnetwork().setcategory(1)
}
}
Afterwards I was able to enable remoting with no problem.
Like this:
Like Loading...
Oh boy, was this post like music to my ears. thanks for sharing, most useful
Very nice, this was driving me nuts. Thanks for posting it.
Beautiful, I was almost to give up. Thanks for sharing. @_@
Thanks Tome, worked a treat!
Good fix. Thanks for posting it.
I’m not sure where you’re getting your information, but good topic. I needs to spend some time learning more or understanding more. Thanks for wonderful info I was looking for this info for my mission.
Worked like a charm, thanks for sharing
more than 2 years later…still usefu
Agreed. Just came across this today, 2 years later, and it was a great help.
First result in my first search to resolve the problem… thanks for the post!
You may also disable all the VMware network adapters. Open | Control Panel | Network and Internet | Network Connections | . Right click all VMware network adapters and click disable.
Thanks — this worked for me!
I was loosing my mind over this! Thanks a lot for posting the code.
Cool, this worked like a charm, thank you sir.
T
Excellent, thank you for sharing.