Jump to content
Sign in to follow this  

Issue with IPAddress

Recommended Posts


I could use some help. I am trying to retrieve IP addresses from server/workstations which I had working fine. I even found the code below in the forum which works. The issue is the ??????????????? you will see returned for IP addresses as the second listing ( in quote tags). The vbscript version works fine that I could tell.

For $objAdapter in $colAdapters
   ConsoleWrite ("Network Adapter " & $n & @CR)
   ConsoleWrite ("================="& @CR)
   ConsoleWrite ("  Description: " & $objAdapter.Description& @CR)
   ConsoleWrite ("  Physical (MAC) address: " & $objAdapter.MACAddress& @CR)
   ConsoleWrite ("  Host name:            " & $objAdapter.DNSHostName& @CR)
   If Not ($objAdapter.IPAddress) = " " Then
      For $i = 0 To UBound($objAdapter.IPAddress)
         ConsoleWrite ("  IP address:            " & $objAdapter.IPAddress($i)& @CR)
   If Not ($objAdapter.IPSubnet) = " " Then
      For $i = 0 To UBound($objAdapter.IPSubnet)
         ConsoleWrite ("  Subnet:                " & $objAdapter.IPSubnet($i)& @CR)
   If Not ($objAdapter.DefaultIPGateway) = " " Then
      For $i = 0 To UBound($objAdapter.DefaultIPGateway)
         ConsoleWrite ("  Default gateway:      " & _
             $objAdapter.DefaultIPGateway($i)& @CR)

Network Adapter 1


Description: Broadcom NetXtreme Gigabit Ethernet - Deterministic Network Enhancer Miniport

Physical (MAC) address: 00:15:58:27:71:B2

Host name: PSCOML3LMBF8

IP address:

IP address: ????(???????????????????????????????????E?+??????G????


Subnet: ????(???????????????????????????????????E?+??????G????

Default gateway:

Default gateway: ????(???????????????????????????????????E?+??????G????



DNS servers in search order:

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.