Change network location on domain machine
Hi All, I have a laptop that is linked to our domain at work. I am also using VMWare for virtualization, this adds two network connections. When first detected, Windows 7 asks if these virtual devices are in a public network. To be sure, I said yes, it is public. Now I would like to open a port on my host machine to a virtual machine, I can open ports on the windows firewall for domain, home/work and public networks. I would like to open IIS up for my VMs, but not to all public networks. Therefore, what I would like to do is to change the network location of both VMWare virtual network adapters to be 'work'. I found a guide that said I could click 'customize' behind the network connection name, but unfortunately I do not have a 'customize' link anywhere in the Network and Sharing Center. Probably due to the fact I am in a domain(?). I found a document here: http://www.microsoft.com/downloads/details.aspx?FamilyID=eceefeb3-2c6b-43fd-becb-acafffdfcbaf&displayLang=en that describes the fact that the link to 'select network location (SNL)' is indeed hidden on domain-joined PCs, yet for domain-joined PCs "changing the network location does not require administrative privileges". But how do I change it if the link is hidden? Could anyone send me off in the right direction? Thanks :)
November 25th, 2009 4:00pm

Man, I just struggled with this one. You need to be able to change this if you want to enable powershell remoting. You can't enable remoting if you have any NICs that are on a public network profile. As you found out the VMWare workstation NICs are added as public, and you can't change them if you're on a domain. I put a writeup on my site, but to summarize here's the powershell script that will change all public profile NICs to be Work Profile 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) } }
Free Windows Admin Tool Kit Click here and download it now
December 28th, 2009 6:45pm

Shame that this is not configurable trough UI, but your script worked flawlessly. Thanks :)
January 5th, 2010 3:55pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics