Jump to content

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)
      Next
   EndIf
 
   If Not ($objAdapter.IPSubnet) = " " Then
      For $i = 0 To UBound($objAdapter.IPSubnet)
         ConsoleWrite ("  Subnet:                " & $objAdapter.IPSubnet($i)& @CR)
      Next
   EndIf
 
   If Not ($objAdapter.DefaultIPGateway) = " " Then
      For $i = 0 To UBound($objAdapter.DefaultIPGateway)
         ConsoleWrite ("  Default gateway:      " & _
             $objAdapter.DefaultIPGateway($i)& @CR)
      Next
   EndIf

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: 10.128.20.29

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

Subnet: 255.255.255.0

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

Default gateway: 10.128.20.254

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

DNS

---

DNS servers in search order:

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...