Skip to content

Instantly share code, notes, and snippets.

@marufeuille
Created October 2, 2016 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marufeuille/73c697fbf981207fe90059f80b03bf86 to your computer and use it in GitHub Desktop.
Save marufeuille/73c697fbf981207fe90059f80b03bf86 to your computer and use it in GitHub Desktop.
$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