Adding multiple IP Addresses on the windows server using a graphical interface is really a pain as each IP Address need to be assigned manually. Through this article, I will show you how to add multiple IP Addresses using PowerShell command.

First, you need to get the Interface Index or Interface Alias of the NIC Interface. Below is the powershell command to get the Interface Index or Interface Alias.

Get-NetAdapter | Select Name, InterfaceIndex
Get-NetAdapter

For the example, Y want to assign the IP 10.100.0.20 to 10.100.0.50 to the Interface named “Ethernet“. Below is the complete PowerShell command to do that.

workflow add-ipaddress {
	Param( [string]$Iplist )
	
	foreach -parallel ($ip in $Iplist){
		New-NetIPAddress -InterfaceIndex 7 -IPAddress $ip -PrefixLength 27
	}
}
$Iplist = 20..50 | % {"10.100.0.$_"}
add-ipaddress $Iplist

We hope this article can help you to add multiple IP Addresses using PowerShell command. If you liked this article, then please share with the others. You can also find us on Twitter and Facebook.