There isn’t an easy way to set the category of an Unidentified network in WS2K8R2 All version

By default, an Unidentified network will be set to Public for security. Often, the Unidentified network is setup intentionally, that script is good when you need change a Network properties and before (e.g. when you promotion a Domain Controller, DNS server, Web server, print server, Wins server)

That debug is generated when you have 2 or more network cards install in your system operative, and you need identify a "private Network" before you use a command prompt (ping, tracert, nslookup) or another command prompt to check the integrity of system, promotion a domain and add the server to created domain

To complete the script correctly in your system, you need follow that steps:

1. Save the script locally as ChangeCategory.ps1 (say under c:\ o a created specific folder)

2. Launch an elevated Powershell command window (Run as Administrator)

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

 

PowerShell
Edit|Remove
# 
# 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)
    }
}