Created
October 2, 2016 07:54
-
-
Save marufeuille/73c697fbf981207fe90059f80b03bf86 to your computer and use it in GitHub Desktop.
This file contains 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
$targets = @("08-00-27-9A-AB-94") | |
$nics = Get-NetAdapter | |
foreach ($nic in $nics) { | |
if ($targets -contains $nic.MACAddress) { | |
New-NetIPAddress -InterfaceIndex $nic.IfIndex -IPAddress "192.168.0.1" -AddressFamily IPv4 -PrefixLength 24 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment