How to create multiple (hundreds) IP address using powershell in single Windows Server VM ?

Posted on 2010-04-08
Medium Priority
Last Modified: 2012-08-13
Hi All,

I'd like to perform a database application transactional and concurrent load testing which requires approx. 100 IP address in a single host (Windows box)
is there any quick way (Powershell 2.0 / netsh ) to create those IP address in one single box ?


Simulator1 -

Simulator2 -

i know how to do it in Windows Server 2003 manually one by one but that's too daunting to do it manually.

Question by:jjoz
LVL 24

Assisted Solution

by:B H
B H earned 2000 total points
ID: 30161992
how about a batch file, adjust fire as necessary on the subnet/ip's

netsh in ip add address "Local Area Connection"
netsh in ip add address "Local Area Connection"
netsh in ip add address "Local Area Connection"
netsh in ip add address "Local Area Connection"
netsh in ip add address "Local Area Connection"

Accepted Solution

jjoz earned 0 total points
ID: 30557042
here it is the script that works:

#setup collection of IP address strings, include original IP
$ips = 1..100 | %{ "10.2.1.$_" }

#also subnet masks, need as many as IP addresses
$masks = 1..100 | %{ "" }

#get the NIC
$nic = Get-WMIObject win32_networkadapterconfiguration -computer VM-Simulator1 | where { $_.IPAddress -contains "" }

#set addresses

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …
This video shows you how easy it is to boot from ISO images for virtual machines with the ISO images stored on a local datastore on the ESXi host.

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question