Windows 8.1 Hyper-V network adapter is set to public and won't save as private
Solution 1
You can exclude certain nics from NLA (Network Location Awareness). Very common to do this in VMware workstation scenarios since the VMware nics always end up as unidentified/public. Here's how:
- Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}
- You will find enumerated keys like 0000, 0001, 0002 and so on.
- Expend them one by one and look for DriverDesc REG_SZ value data.
- In the same registry key where you found the name of the nic to exclude (DriverDesc value), create another new DWORD Value, name it
*NdisDeviceType
(it Case Sensitive!!). Double click on this value and in "Value Data" field put 1 as Decimal data
(snipped from) http://www.petri.co.il/forums/showthread.php?t=45181
Solution 2
You can set all unidentified networks as private via Group Policy:
gpedit.msc
> Computer Configuration > Windows Settings > Security Settings > Network List Manager Policies > Unidentified Networks > Location type: Private
Related videos on Youtube
Richthofen
Software developer working principally in .NET tech (but I dabble in all sorts of other stuff too). Check out the IFPA Companion app I wrote https://play.google.com/store/apps/details?id=com.edgiardina.ifpa&hl=en_US&gl=US https://apps.apple.com/lb/app/ifpa-companion/id1441736303
Updated on September 18, 2022Comments
-
Richthofen almost 2 years
I have a collection of Windows 8.1 machines that run Hyper-V for unit testing. We often use PowerShell to script changes to these systems to ease our administration. However, we've been having trouble enabling powershell remoting on these machines.
We run the following command on these machines to attempt powershell remoting enabling
Enable-PSRemoting -force
But we always get the following error:
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.
The network adapters Are as follows:
Name : Network 2 InterfaceAlias : vEthernet (Broadcom NetXtreme Gigabit Ethernet) InterfaceIndex : 13 NetworkCategory : Private IPv4Connectivity : Internet IPv6Connectivity : LocalNetwork Name : Unidentified network InterfaceAlias : vEthernet (Windows Phone Emulator Internal Switch) InterfaceIndex : 10 NetworkCategory : Public IPv4Connectivity : NoTraffic IPv6Connectivity : NoTraffic
I tried running the following scripts to set the unidentified network to be private
Set-NetConnectionProfile -name "Network 2" -NetworkCategory private Set-NetConnectionProfile -name "Unidentified Network" -NetworkCategory private
However these scripts work for the duration of the machine's uptime, but when the machine reboots, the Unidentified network reverts back to the public.
Why is this resetting, and how can I get the scripted change to persist?
Thanks!
-
Moshe Katz over 10 years"Unidentified Network" is why. Windows sees it as a new network each time and doesn't remember that it is the same "Unidentified" one that was there before. Easiest workaround it just to run a startup script that will rerun these commands.
-
Robert Westerlund over 10 yearsIf all you really want to do is to enable psremoting you could use add the -Force parameter to the Enable-PSRemoting cmdlet, even though the firewall rule won't open up to traffic with the emulator switch.
-
Richthofen over 10 yearsI am using the -Force flag w/ PSRemoting cmdlet, still get the error.
-