Change ‘Unidentified network’ from Public to Work in Windows 7


There isn’t an easy way to set the category of an Unidentified network in Windows 7 RC+ builds. By default, an Unidentified network will be set to Public for security. Often, the Unidentified network is setup intentionally (e.g. two machines connected via a hub; a network TV tuner, etc.). In these cases, Home/Work is a better category to allow common network tasks to succeed.

Below is a Powershell script to change the category from Public to Work (identical to Home, except Homegroup won’t be started up). You need to be already connected to the ‘Unidentified network’ prior to running this script.

 

  1. Save the script locally as ChangeCategory.ps1 (say under c:\)
  2. Launch an elevated Powershell command window
  3. Change your execution policy to allow the script to run (if not already changed)
    PS> set-executionpolicy remotesigned
  4. Run the script
    PS> c:\ChangeCategory.ps1

At the end of this, the category for the Unidentified network will show as Work in Network and Sharing Center. This setting is not persisted across re-connects and you will require to run the script again to change the category. Be sure to run the script only for networks that you trust since this affects the firewall profile that will be used.


Comments (26)

  1. Ben Laan says:

    Powershell requires # as a comment indicator, not // – this needs to be fixed in order to run this script

  2. tim says:

    Not working for me,

    running windows 7 ultimate 64bit

  3. David Auth says:

    Works just fine in 2008 R2 Enterprise in an elevated PS window after setting the policy.  Just follow the instructions and your unidentified network will go from public to private, swiftly and easily.  Thank you!

  4. Arcana says:

    @tim: it works, just replace // with #, because the comment indicator is wrong. I've tested it my self :)

  5. Rich says:

    On Windows Server 2008 R2, this setting can be permanently changed using Administrative Tools > Network List Manager Policies > Unidentified Networks > Properties.

    See here for more info:

    blog.kazmarek.com/…/change-default-behavior-for-unidentified-network-in-vistawindows-server-2008windows-7

  6. kei says:

    does windows 7  has direct cable connection program?

  7. kei says:

    does windows 7 has drect cable connection program?

  8. RSOLY777 says:

    I just did this on my machine and this worked

    1. Start –> run –> MMC –> press enter

    2. In MMC console , from menu file select Add/Remove Snap-in

    3. Select Group Policy Object editor –> Press Add –> select Local computer –> press OK –>press OK

    4. Open Computer configration –>Windows Settings –>Security Settings –>select Network list manager policies

    on the right Side you will see options for :

    double click –>Unidentified networks

     Then you can select the option to consider the Unidentified networks as private and if user can change the

    location except I set this to User can change Network Location

    This worked for me.!

  9. Sanya says:

    I'm getting a

    Missing '>' in method call

    At C:ChangeCategory.ps1:2 char:37

    + $NLMTYPE = [Type]:GetTypeFromCLSID< <<<< ‘DCB00C01-570F-4A9B-8D69-199FDBA5723B’>

        + CategoryInfo           : ParserError: <CloseParenToken:TokenId> [], ParseException

        + FulluQualifiedError : MissingEndParenthesisInMethodCall

  10. Sanya says:

    I'm getting a

    Missing '>' in method call

    At C:ChangeCategory.ps1:2 char:37

    + $NLMTYPE = [Type]:GetTypeFromCLSID< <<<< ‘DCB00C01-570F-4A9B-8D69-199FDBA5723B’>

        + CategoryInfo           : ParserError: <CloseParenToken:TokenId> [], ParseException

        + FullyQualifiedError : MissingEndParenthesisInMethodCall

  11. Harveyboy says:

    GPO worked for me… don't forget to apply the policy… gpupdate.exe /force

  12. Ken says:

    In the script, apart from changing the // to #, you need to use double quotes for the GetTypeFromCLSID string ‘DCB00C01-570F-4A9B-8D69-199FDBA5723B’

  13. dimeby8 says:

    Thanks for the comments pointing out the comments and the quotes issue in the script. The script is now updated.

  14. ridgerunner says:

    After two days of frustration I found  RSOLY777's fix above.  It worked perfectly for me.  I can see files on both networked machines, and I can connect to the internet from both machines.  I have a USB modem attached to a Dell XPS 9100 with Windows 7 64-bit, and D-Link DIR-655 router, and a NetGear N150 wireless USB adapter on the second PC.  Thank you so much.

  15. Biku Bhai says:

    RSoly777 is a star. Worked a treat!

  16. jacemace says:

    @RSoly777

    There is no Group Policy Object editor in add or remove snap-ins.

    Please help.

  17. Derek says:

    i found that GPO is not in Win 7 home, it's only in Pro or Ultimate version.

  18. Jayden says:

    I kind of have the opposite problem. How do you make it so that any network is set to private or work? I see the options for "Unidentified" and "Identifying" , but not once the network is identified and waiting for the user to select a network type. There is a check box to mark all networks as public and don't ask again, where is the option to mark all networks as private and don't ask again?

  19. surtep says:

    yes its working now…but as work network not home network.  Home & work netwok are one and the same thing.  JUST REMEBER if change the security policy like this….every unidentified network will be a work network!  Better invest in a good firewall…….

  20. Sheepdog says:

    @RSOLY777

    Worked great for myself and a colleague, many thanks!

  21. sscslions says:

    I ran the script and the network type changed from Public  to Work but is still "unidentified network", therefore not internet acccess

  22. steve says:

    Quotes, double quotes, or(

    this format

    )

    throws me an unexpected token error (see below). Any ideas, anyone?

    Unexpected token 'GetTypeFromCLSID' in expression or statement.

    At C:UsersSteveDesktopChangeCategory.ps1:19 char:34

    + $NLMType = [Type]GetTypeFromCLSID <<<< ("DCB00C01-570F-4A9B-8D69-199FDBA5723B")

       + CategoryInfo          : ParserError: (GetTypeFromCLSID:String) [], ParseException

       + FullyQualifiedErrorId : UnexpectedToken

  23. Thom says:

    Nice going RSOLY777! Changed from public to work!

    Kudos to you!

    —————————————————————————————

    "1. Start –> run –> MMC –> press enter

    2. In MMC console , from menu file select Add/Remove Snap-in

    3. Select Group Policy Object editor –> Press Add –> select Local computer –> press OK –>press OK

    4. Open Computer configration –>Windows Settings –>Security Settings –>select Network list manager policies

    on the right Side you will see options for :

    double click –>Unidentified networks

    Then you can select the option to consider the Unidentified networks as private and if user can change the

    location except I set this to User can change Network Location"

  24. Nico says:

    It works, thank you :-)

    Just a "problem" again : the network category icon is still public icon. Is it possible to change that ? For example  $INetwork.SetIcon or another function like that ?

  25. Ollie says:

    It worked…until I unplugged the ethernet cable then plugged it back in and it returned to public :( Any ideas? They are laptops so will be unplugged often

  26. Elkhan Aliyev says:

    1. Start –> run –> MMC –> press enter

    2. In MMC console , from menu file select Add/Remove Snap-in

    3. Select Group Policy Object editor –> Press Add –> select Local computer –> press OK –>press OK

    4. Open Computer configration –>Windows Settings –>Security Settings –>select Network list manager policies

    on the right Side you will see options for :

    double click –>Unidentified networks

    Then you can select the option to consider the Unidentified networks as private and if user can change the

    location except I set this to User can change Network Location

    This worked for me.! TOOOOOOOOOOO. THANKS Very much