Darene Lewis [MSFT]
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.
# # Name: ChangeCategory.ps1 # Copyright: Microsoft 2009 # Revision: 1.0 # # This script can be used to change the network category of # an 'Unidentified' network to Private to allow common network # activity. This script should only be run when connected to # a network that is trusted since it will also affect the # firewall profile used. # This script is provided as-is and Microsoft does not assume any # liability. This script may be redistributed as long as the file # contains these terms of use unmodified. # # Usage: # Start an elevated Powershell command window and execute # ChangeCategory.ps1 # $NLMType = [Type]::GetTypeFromCLSID('DCB00C01-570F-4A9B-8D69-199FDBA5723B') $INetworkListManager = [Activator]::CreateInstance($NLMType) $NLM_ENUM_NETWORK_CONNECTED = 1 $NLM_NETWORK_CATEGORY_PUBLIC = 0x00 $NLM_NETWORK_CATEGORY_PRIVATE = 0x01 $UNIDENTIFIED = "Unidentified network" $INetworks = $INetworkListManager.GetNetworks($NLM_ENUM_NETWORK_CONNECTED) foreach ($INetwork in $INetworks) { $Name = $INetwork.GetName() $Category = $INetwork.GetCategory() if ($INetwork.IsConnected -and ($Category -eq $NLM_NETWORK_CATEGORY_PUBLIC) -and ($Name -eq $UNIDENTIFIED)) { $INetwork.SetCategory($NLM_NETWORK_CATEGORY_PRIVATE) } }
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.
Powershell requires # as a comment indicator, not // - this needs to be fixed in order to run this script
Not working for me,
running windows 7 ultimate 64bit
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!
@tim: it works, just replace // with #, because the comment indicator is wrong. I've tested it my self :)
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
does windows 7 has direct cable connection program?
does windows 7 has drect cable connection program?
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.!
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
+ FullyQualifiedError : MissingEndParenthesisInMethodCall
GPO worked for me... don't forget to apply the policy... gpupdate.exe /force
In the script, apart from changing the // to #, you need to use double quotes for the GetTypeFromCLSID string ‘DCB00C01-570F-4A9B-8D69-199FDBA5723B’
Thanks for the comments pointing out the comments and the quotes issue in the script. The script is now updated.
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.
RSoly777 is a star. Worked a treat!
@RSoly777
There is no Group Policy Object editor in add or remove snap-ins.
Please help.
i found that GPO is not in Win 7 home, it's only in Pro or Ultimate version.
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?
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.......
@RSOLY777
Worked great for myself and a colleague, many thanks!