Advertisement

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.

Advertisеment

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 PrivateNetwork Type Is Private Network Center
    Your network location type will be set to Public.

That's it.

 

 

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

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

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

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.