Tuesday, February 16, 2021

Changing the network location from Public to Private on Windows Server

By Steve Endow

This is just a post for me to store this information for Future Steve, as he will most certainly need it, just as Present Steve has needed it a dozen times over the last year.

Any time I replace my router, replace a piece of Ubiquiti network gear, or reconfigure my network, all of my Windows Server VMs decide they've been kidnapped and change their network location to Public network.

This blocks all traffic on the servers until I can login directly to each server and fix the problem.

Which requires an annoying process using gpedit or PowerShell, which I can never remember after 6 months.

So here is the post with the information to fix the problem:

https://serverfault.com/questions/639088/how-do-i-make-a-connection-private-on-windows-server-2012-r2

Using the GUI:

  1. Hit Winkey + R to open Run prompt and type gpedit.msc
  2. Navigate to: Computer Configuration/Windows Settings/Security Setting /Network List Manager Policies.
  3. Choose your Network name in the right pane.
    Note: To show networks not currently connected, right-click Network List Manager Policies in the left pane and choose Show All Networks.
  4. Go to Network Location tab and change the Location type from Public to Private.


Using PowerShell...

One line version:

Set-NetConnectionProfile -InterfaceAlias Ethernet -NetworkCategory Private

Multi-line version:

PS C:\>$Profile = Get-NetConnectionProfile -InterfaceAlias Ethernet1

PS C:\>$Profile.NetworkCategory = "Private"

PS C:\>Set-NetConnectionProfile -InputObject $Profile


Steve Endow is a Microsoft MVP in Los Angeles.  He works with Dynamics 365 Business Central, Microsoft Power Automate, Power Apps, Azure, and .NET.

You can also find him on Twitter and YouTube

No comments:

Post a Comment

All comments must be reviewed and approved before being published. Your comment will not appear immediately.

Software Algorithms to Solve Messy Data Problems

 By Steve Endow In the software / consulting world, we're sometimes given data that is messy, and we, the software developers, consultan...