This is the script we use.
PHP Code:
On Error Resume Next
Dim WSHShell
RegKeystrComputer

Set WSHShell 
CreateObject("WScript.Shell")
RegKey "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName"
strComputer WSHShell.RegRead(RegKey)

IPDetails "Error reading IP address. Computer name incorrect."

Set objWMIService GetObject ("winmgmts:" "{impersonationLevel=impersonate}!\\"strComputer "\root\cimv2")
Set colAdapters objWMIService.ExecQuery ("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = True")

For 
Each objAdapter in colAdapters
    
If Not IsNull(objAdapter.IPAddressThen
        
if LEN(objAdapter.IPAddress)>0 Then
        
If IPDetails="Error reading IP address. Computer name incorrect." Then
            IPDetails 
"NIC Description: " objAdapter.Description
        
else
            
IPDetails IPDetails vbcrlf vbcrlf "NIC Description: " objAdapter.Description
        End 
If    

        
IPDetails IPDetails vbcrlf "Physical address : " objAdapter.MACAddress

        
For LBound(objAdapter.IPAddressTo UBound(objAdapter.IPAddress)
            
IPDetails IPDetails vbcrlf "IP address          : " objAdapter.IPAddress(i)
        
Next

        
If Not IsNull(objAdapter.IPSubnetThen
            
For LBound(objAdapter.IPSubnetTo UBound(objAdapter.IPSubnet)
                
IPDetails IPDetails vbcrlf "Subnet                : " objAdapter.IPSubnet(i)
            
Next
        End 
If

        If 
Not IsNull(objAdapter.DefaultIPGatewayThen
            
For LBound(objAdapter.DefaultIPGatewayTo UBound(objAdapter.DefaultIPGateway)
                
IPDetails IPDetails vbcrlf "Default gateway : " objAdapter.DefaultIPGateway(i)
            
Next
        End 
If

        If 
Not IsNull(objAdapter.DNSServerSearchOrderThen
            
For LBound(objAdapter.DNSServerSearchOrderTo UBound(objAdapter.DNSServerSearchOrder)
                
IPDetails IPDetails vbcrlf "DNS server         : " objAdapter.DNSServerSearchOrder(i)
            
Next
        End 
If
        
End If
    
End If
Next

if IPDetails "Error reading IP address. Computer name incorrect." then
    q
=msgbox(UCase(strComputer) & vbcrlf vbcrlf  IPDetails,48,"Display IP Config")
Else
    
q=msgbox(UCase(strComputer) & vbcrlf vbcrlf  IPDetails,64,"Display IP Config")
End If