I have to set two different network categories public and private to two different lan adapters. There are multiple firewall rules that open ports that only shall apply to the LAN.
Whenever I execute the command:
Set-NetConnectionProfile -Name "NetworkName" -NetworkCategory Private
This automatically sets the category for BOTH adapters. When I choose public, public is applies to booth adapters, when I use private, private is applied to booth adapters. I tried this with network alias and network interface, because network name is identical for booth and shows "unidentified network".
What can lead to this behavior? I try to set the connection policy while the networks are currently inactive, but this should not explain this behavior? Is it possible to directly attach a network category to the hardware? I observed, that the interface index is keep changing during reboots and in the past the network category assignment did as well, leading to security issues.