WMI and adding Multiple IP Addresses?
Is it possible, with WMI, to bind IP addresses to a NIC? I have been able to enable a static IP, but I can't seem to find any information on adding additional IPs.
this code helped and after I realized that the IP address and Subnet fileds were arrays it made more sense: https://stackoverflow.com/questions/209779/how-can-you-change-network-settings-ip-address-dns-wins-host-name-with-code
Basically, when you assign the IPs and subnets you separate the different items with commas so:
newIP["IPAddress"] = new string[] { "1.1.1.1", "1.1.1.2"};
newIP["SubnetMask"] = new string[] { "255.255.255.0","255.255.255.0"};
I assume you are using the EnableStatic method of the Win32_NetworkAdapterConfiguration class to assign a static IP?
If so, the MSDN documentation refers the the IP address and gateway parameters as lists, perhaps you can use arrays to assign multiple addresses?
Sorry, I don't have easy access to a Windows machine I can test with at the moment. Maybe later when I'm at home.
http://msdn.microsoft.com/en-us/library/aa390383(v=VS.85).aspx