Change network location type with PowerShell in Windows 10

In one of my previous articles, I wrote how you can change the network location type (Public or Private) in Windows 10. Today, I would like to share with you how it can be done with PowerShell.

When you are signing in to your account for the very first time, Windows 10 asks you which kind of network you are connecting to: Home or Public.

windows 10 build 10074 network type

If you pick Yes, the OS will configure it as a private network and turn on network discovery. For a Public network, discovery and access will be limited. You won't be able to browse the Windows network from other PCs and their shares. If you need to access your computer from a remote PC or browse the PCs and devices on your local network, you need to set it to Home (Private). Here is how you can do it using PowerShell.

PowerShell is an advanced form of command prompt. It is extended with a huge set of ready-to-use cmdlets and comes with the ability to use .NET framework/C# in various scenarios.

To change network location type with PowerShell in Windows 10

  1. Open PowerShell as Administrator.
  2. Type or copy-paste the following command:
    Get-NetConnectionProfile
  3. In the command output, see the line "Name". It contains the name of your network which you need to use with the next command.
  4. To set the network location type to Public, type or copy paste the following command:
    Set-NetConnectionProfile -Name "Your Network Name" -NetworkCategory Public

    Replace the "Your Network Name" with your actual network name you got from the previous command.Set Network Type With PowerShellYour network location type will be set to Public.
    Network Type Is Public

  5. To set the network location type to Private, type or copy paste the following command:
    Set-NetConnectionProfile -Name "Your Network Name" -NetworkCategory Private

    Replace the "Your Network Name" with your actual network name you got from the Get-NetConnectionProfile command.
    Network Type Is Private Network Type Is Private Network Center
    Your network location type will be set to Public.

That's it.

 

 

1 thought on “Change network location type with PowerShell in Windows 10

  1. David Anderson

    Hi Sergey,
    Your PowerShell command worked fine to change my Ethernet network location from Public to Private on a laptop running Windows 10 Home v1809, but it switched back to Public as soon as I rebooted the machine. Is there a way to make this network location setting permanent?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.