change unidentified network from public to work in windows 7

From WebHostingNeeds.com
Revision as of 15:33, 20 February 2011 by Admin (talk | contribs) (Created page with "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. This happens on VMWare virtual machi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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. This happens on VMWare virtual machine.

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.

File:powershell change network.jpg

After doing this, Network and Sharing Center will show

File: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...

File:firewall undefined network.jpg