change unidentified network from public to work in windows 7

From WebHostingNeeds.com
Jump to: navigation, search

After upgrading Main computer (one that connect to DSL modem) on LAN, other PC's are able to get internet. But failed to ping on 192.168.0.1.


Method 1

Go to

Start > Search > secpol.msc

Navigate to

Network List Manager Policies > Unidentified Networks

Double Click and Change Location Type to

Private

Warning This means from now on all Unidentified Networks will be set as private!!


Method 2

NOTE: This is temporary solution, on rebooting, changes will be lost

This is caused by Network card that connect to lan with IP 192.168.0.1 is assigned as a "Public Network". Public Network have many features disabled for security.

To fix this, run "ChangeCategory.psl" on Power Shell running as Administrator.

Copy and paste following content to a text file, save it as ChangeCategory.psl

$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)
    }
}


Now run power shell as administrator.

Type

set-executionpolicy remotesigned
ChangeCategory.ps1 

This should be done in folder where ChangeCategory.ps1 is saved.

Powershell change network.jpg

After doing this, Network and Sharing Center will show

Network undefined network.jpg

Windows Firewall will show "undefined network" in "Home or work (private) networks". Being in private network, you get privileges to share, ping etc...

Firewall undefined network.jpg



windows 7