Information Technology Reference
In-Depth Information
3.
Click on Internet Protocol (TCP/IP), and select Properties.
4.
Select the Alternate Configuration tab. Select the radio button next to User Configured.
5.
Enter the static address information in the following text boxes:
IP Address (required)
Subnet Mask (required)
Default Gateway
Primary DNS Server (for the alternate configuration)
Alternate DNS Server (for the alternate configuration)
Preferred WINS Server
Alternate WINS Server
6.
Click OK when you're finished.
Using VBScript
This code configures the Registry blob that enables alternate IP configuration on a particular
NIC. Before you run this script, you need to obtain the GUID for the appropriate NIC at the
command line using the following syntax:
> wmic nicconfig get ipaddress,settingid > \foo.txt
> for /f "tokens=2" %a in ('type foo.txt ^| findstr
"<IP Address>"') do echo %a
Here is the VBScript code:
' ------ SCRIPT CONFIGURATION ------
Const CONNECTED = 2
Const HKEY_LOCAL_MACHINE = &H80000002
Const strComputer = "."
' Modify the following six variables
' to meet the needs of your environment
strTargetGUID = "{01B3816C-AB47-3E53-CB7C-88345293465}"
strAlternateIP = "192.168.1.151"
strAlternateMask = "255.255.255.0"
strAlternateGW = "192.168.1.1"
strAlternateDNS1 = "192.168.1.120"
strAlternateDNS2 = "192.168.1.121"
' ------ END CONFIGURATION ---------
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")