Created
January 7, 2018 22:02
-
-
Save abelal83/1ab1beb0972c7b01b8682717c9e4cdd1 to your computer and use it in GitHub Desktop.
change windows NIC profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this was used to get around vmware network card being set to public which powershell remoting does not like | |
$domain = 2 | |
$workHome = 1 | |
$public = 0 | |
$nlm = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")) | |
$connections = $nlm.getnetworkconnections() | |
foreach ($connection in $connections) { | |
if ($connection.getnetwork().getcategory() -eq $public) | |
{ | |
$connection.getnetwork().setcategory($workHome) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment