How to change public network to private


  1. Posts : 1,680
    X
       #1

    How to change public network to private


    My wife's laptop jumped into public network mode yesterday for no known reason.

    I remember that it happened to my desktop last year, and I found instructions online showing how to change it back.

    So yesterday we searched online and she found the secpol.msc method.
    I rejected that solution because I "knew" that the policy editors are only available on the Windows Pro editions, and we have Windows Home.

    Oh wait! I was wrong. Her laptop has Pro. S'good. So we did the secpol thing and it's fixed.

    But back to my desktop ... which really is Windows Home. No secpol is available.
    So how the heck did I change it back from public to private last year? I cannot remember.
    Even if I remembered ... it might be moot because MS is always changing the settings panel with every new release.

    So ... after that long-winded tale ... how do I change public to private on Windows 10 Home 1803 ?
      My Computer


  2. Posts : 31,666
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #2
      My Computers


  3. Posts : 86
    Windows 7 Professional x64
       #3

    Here is another interesting article:

    Add Network Location Type Context Menu in Windows 10
      My Computer


  4. Posts : 1,680
    X
    Thread Starter
       #4

    That was the first solution we found online ...
    Bree said:
    But it doesn't work here.

    At this point in your instructions ... I click on the network icon (yours says Brink, mine says GFIBER239) ...


    ... and I get this:

    There is no Make this PC discoverable slider.
    There are no public/private buttons.
    If it helps ... winver says I'm running version 1803 (build 17134.228)
      My Computer


  5. Posts : 1,680
    X
    Thread Starter
       #5

    This solution worked for me ...
    lolnothankyou said:
    Here is another interesting article:Add Network Location Type Context Menu in Windows 10
    I'd prefer not to leave my context menu cluttered with the extra menu entry.
    Is there a way to turn that into a command-line script? One script for public. One script for private.
      My Computer


  6. Posts : 1,471
    Win10 Home x64 - 1809
       #6

    I'd prefer not to leave my context menu cluttered with the extra menu entry.
    Is there a way to turn that into a command-line script? One script for public. One script for private.
    There was link on that page to use PowerShell - Change network location type with PowerShell in Windows 10
      My Computers


  7. Posts : 1,680
    X
    Thread Starter
       #7

    I found a way to do that with bash ...
    Code:
    # netpub / netpri - Change network type to public or private
    
    Base=$(basename "$0")
    
    case "$Base" in
      netpub) type="public";;
      netpri) type="private";;
           *) exit 1;;
    esac
    
    case "$type" in
       public) PowerShell -windowstyle hidden -Command "Start-Process PowerShell -ArgumentList '\$net = get-netconnectionprofile;Set-NetConnectionProfile -Name \$net.Name -NetworkCategory Public' -Verb RunAs"
               echo "network set to public";;
      private) PowerShell -windowstyle hidden -Command "Start-Process PowerShell -ArgumentList '\$net = get-netconnectionprofile;Set-NetConnectionProfile -Name \$net.Name -NetworkCategory Private' -Verb RunAs"
               echo "network set to private";;
    esac
    
    exit 0
      My Computer


  8. Posts : 5,478
    2004
       #8

    Eagle51 said:
    There was link on that page to use PowerShell - Change network location type with PowerShell in Windows 10
    A simpler way to set all private with powershell (no need to enter specific names)
    Code:
    $NetConnectionProfiles = Get-NetConnectionProfile  | Where-Object {$_.NetworkCategory -eq 'Public'}
    ForEach ($NetConnectionProfile in $NetConnectionProfiles) {
    	Set-NetConnectionProfile -NetworkCategory Private
    }
      My Computer


  9. Posts : 31,666
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #9

    margrave55 said:
    But it doesn't work here.

    At this point in your instructions ... I click on the network icon (yours says Brink, mine says GFIBER239) ...

    ... and I get this:

    There is no Make this PC discoverable slider.
    There are no public/private buttons.
    If it helps ... winver says I'm running version 1803 (build 17134.228)
    I have two machines, one Pro the other Home, both on 17134.228. Both are connected by WiFi to the same router. The blue 'Change connection properties' link on Settings > Network & Internet > Status should take you to the Network Profile settings - one does, the other doesn't.

    How to change public network to private-change-connection-proprties.png

    There are other ways to get to that page, one machine allows me to set Public/Private, the other doesn't.

    How to change public network to private-network-status.png

    How to change public network to private-network-status-hyper-v.png

    Two possible reasons for this are given in the note for Option One, step 7 in Brink's tutorial....

    Note   Note
    Make this PC discoverable settings will not be available if you have UAC set to Always notify. Setting UAC to a different level will allow Make this PC discoverable settings to be available.

    Make this PC discoverable settings will not be available if you have a Hyper-V virtual switch with this Ethernet connection....
    Set Network Location to Private or Public in Windows 10 | Windows 10 Tutorials

    In my case, The Pro machine is using Hyper-V.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:30.
Find Us




Windows 10 Forums