I need a vbscript that will list IP addresses of remote servers. I am supplying the server names in an excel spreadsheet and would like the code to supply the IP address. The code seems to work for my machine but not remote devices.
Dim strComputer As String
intRow = 2
Do While Worksheets("MISC").Cells(intRow, 1).Value <> ""
strComputer = Worksheets("MISC").Cells(intRow, 1).Value
On Error GoTo GotError
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"Select IpAddress From Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
For Each objItem In colItems
Worksheets("MISC").Cells(intRow, 2).Value = objItem.IPAddress
intRow = intRow + 1 'look at next row's cell value
Any help would be appreciated.