How to force network profile to Private for every network connection?

Brian890504 31 Reputation points
2022-10-08T13:37:40.25+00:00

Hi,

I am doing a system deployment where it consists of a few windows machines that form a local network and exchange data between each machine. It is a requirement from the software vendor that these windows machines must be running in Private network profile in order to get the system works without issues.

The local area network is then linked to a router for an internet connection.

My problem is every time I provision the setup in my staging lab when I move it to the client side during the actual installation date, the network profile seems to change to Public automatically once it is connected to the client side network.

Please take note that the network name is not pre-specified for the client-side router, thus I am not able to simply pre-set the network profile in the Windows registry.

Even though it can be manually switching to Private network profile, I would like to know does anyone how can we fix all the future upcoming network profiles to stay Private no matter which network it connects to.

Windows for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
0 comments No comments
{count} vote

Accepted answer
  1. Anonymous
    2022-10-08T13:49:12.153+00:00

    You could do

    Set-NetConnectionProfile -InterfaceAlias myEthernet -NetworkCategory "Private"  
    

    https://learn.microsoft.com/en-us/powershell/module/netconnection/set-netconnectionprofile?view=windowsserver2022-ps

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.