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
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?