Adding IPs Quickly to a Windows Server

Adding a single IP to a windows server is simple enough but when you need to add say 16 IPs, the process can become tedious. Below is a command you can run from the command line to add IPs quickly to a Windows server1). The command could easily be used in a batch script to add hundreds of IPs if necessary. The below command adds the IP address of 192.168.1.2 with the netmask of 255.255.255.0 to the “Local Area Connection” interface:

netsh interface ip add address "Local Area Connection" 192.168.1.2 255.255.255.0

If you wanted to add a range say from 192.168.1.2 through 192.168.1.254 you could do:

 FOR /L %I IN (2,1,254) DO netsh interface ip add address "Local Area Connection" 192.168.1.%I 255.255.255.0

1)
This has been tested and works in all versions of Windows Server 2000, 2003, and 2008.