Welcome Guest ( Log In | Register )


 
Reply to this topicStart new topic
> Script To Change ΅unidentified NetworkΆ From Public To Work In Ws2k8 R2
www.yourforum.gr
post 23 Aug 2011, 11:31 PM
Post #1


No comments
Group Icon

Group: Admin
Posts: 31636
Joined: 8-July 05
Member No.: 121
Zodiac Sign: I'm a leo!
Gender: I'm a m!





There isnΆt an easy way to set the category of an Unidentified network in Windows 7/WS2K8R2. 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. Use this PowerShell script from

CODE
http://blogs.msdn.com/dimeby8/archive/2009/06/10/change-unidentified-network-from-public-to-work-in-windows-7.aspx


to change the category from Public to Work (identical to Home, except Homegroup wonΆt be started up).

You must connect to the ΅Unidentified networkΆ prior to running this script.

PowerShell


CODE
//  
// 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)
    }
}


--------------------
Go to the top of the page
 
Bookmark this: Post to Del.icio.usPost to DiggPost to FacebookPost to GooglePost to SlashdotPost to StumbleUponPost to TechnoratiPost to YahooMyWeb
+Quote Post
www.yourforum.gr
post 23 Aug 2011, 11:37 PM
Post #2


No comments
Group Icon

Group: Admin
Posts: 31636
Joined: 8-July 05
Member No.: 121
Zodiac Sign: I'm a leo!
Gender: I'm a m!



Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to

ή αλλιώς ... το ανέκδοτο με τον Πόντιο και τη βάρκα το ξέρετε ? kolobok.lol.gif

ξεκινάς να πάρεις ένα site backup για να δουλέψεις,

μετά λες ας το στείλω στον Home FTP

μετά το SERVU ζητάει ανανέωση

μετά κάνεις restart το VmWare Instance

μετά κολλάει το DroboPro

μετά ψάχνεις να βρείς γιατί

μετά βλέπεις πως το iSCSI κόβεται από το firewall (κακώς)

μετά πας να ανοίξεις το Rule

τότε βλέπεις πως η σύνδεση iSCSI είναι Public / Unindentified λόγω DHCP absennse ( single LAN cable PC > DroboPro )

μετά προσπαθείς επί ώρα να την κάνεις trusted

μετά συνειδητοποιείς πως το NLA (Network Location Awareness) της Microsoft δημιουργεί πολλά προβλήματα για να εξυπηρετήσει υποτίθεται την ευκολία σου

μετά δεν βρίσκεις πουθενά τρόπο εκτός από Registry επεμβάσεις

μετά όμως βρίσκεις το PowerShell script

το σώζεις με extension .PS1

μετά όμως η πολιτική του server πρέπει να αλλάξει από Restricted σε RemoteSigned

έτσι τρέχεις

CODE
Get-ExecutionPolicy


και μετά

CODE
Set-ExecutionPolicy RemoteSigned


αν θες στο τέλος το επαναφέρεις με

CODE
Set-ExecutionPolicy Restricted


αυτά ...

NLA My @$$


--------------------
Go to the top of the page
 
+Quote Post
NickTheGreek
post 23 Aug 2011, 11:48 PM
Post #3


Administrator
Group Icon

Group: Admin
Posts: 111157
Joined: 3-June 05
From: Athens, Greece
Member No.: 1
Zodiac Sign: I'm a leo!
Gender: I'm a m!






--------------------

c:\ When the going gets tough, the tough get going ...
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 29th March 2024 - 12:30 AM
Skin and Graphics by Dan Ellis and Anubis. Hosting by Forums & More © 2005-2011.
InvisionGames - Your #1 Arcade Games Repository | AllSigs - Signatures for all | Rock Band + Guitar Hero = RockHero ! | The Remoters - Remote Assistance | FileMiners - You ask, We find