List IP Addresses (VBScript)
- Details
- Category: Scripts and Code
- Published on Tuesday, 08 November 2011 08:54
- Written by Christian Dunn
This script displays a list of all IP addresses assigned to the current machine.
Dim IPstring
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set IPConfigSet = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
IPstring = ""
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
IF not left(IPConfig.IPAddress(i),7) = "0.0.0.0" then
IPstring = IPstring & IPConfig.IPAddress(i) & vbCrLF
end if
Next
End If
NextMsgbox IPstring,64,"IP Addresses"