Information Technology Reference
In-Depth Information
Using the Registry
To confirm the static IP address of your computer, examine the following registry keys:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\
Interfaces\{<Interface GUID>}]
"IPAddress"=REG_MULTI_SZ:" <IP Address> "
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\
Interfaces\ {<Interface GUID>} ]
"SubnetMask"=REG_MULTI_SZ:" <Subnet Mask> "
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\
Interfaces\ {<Interface GUID>} ]
"DefaultGateway"=REG_MULTI_SZ:" <Default Gateway> "
To confirm that your computer is receiving an IP address from a DHCP server, confirm
that the following registry key is set to 1 :
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\
Interfaces\ {<Interface GUID>} \]
"EnableDHCP"=dword:1
Using VBScript
This code displays the TCP/IP configuration for a computer.
' ------ SCRIPT CONFIGURATION ------
strComputer = "."
' ------ END CONFIGURATION ---------
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set nics = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
' set a counter to number the NICs, in case you need to display info
' for more than one.
n = 1
WScript.Echo
For Each nic in nics
WScript.Echo "Network Interface Card: " & n
WScript.Echo "================="
WScript.Echo " Description: " & nic.Description
WScript.Echo " Physical (MAC) address: " & nic.MACAddress
WScript.Echo " Host name: " & nic.DNSHostName
Search WWH ::




Custom Search