Information Technology Reference
In-Depth Information
WScript.Echo " DHCP enabled: " & nic.DHCPEnabled
WScript.Echo " DHCP server: " & nic.DHCPServer
If Not IsNull(nic.DHCPLeaseObtained) Then
utcLeaseObtained = nic.DHCPLeaseObtained
strLeaseObtained = WMIDateStringToDate(utcLeaseObtained)
Else
strLeaseObtained = ""
End If
WScript.Echo " DHCP lease obtained: " & strLeaseObtained
If Not IsNull(nic.DHCPLeaseExpires) Then
utcLeaseExpires = nic.DHCPLeaseExpires
strLeaseExpires = WMIDateStringToDate(utcLeaseExpires)
Else
strLeaseExpires = ""
End If
WScript.Echo " DHCP lease expires: " & strLeaseExpires
' now display WINS configuration information
WScript.Echo
WScript.Echo " WINS settings"
WScript.Echo " -------------"
WScript.Echo " Primary WINS server: " & nic.WINSPrimaryServer
WScript.Echo " Secondary WINS server: " & nic.WINSSecondaryServer
WScript.Echo
' move to the next adapter, if applicable
n = n + 1
Next
' takes a UTC date string and displays it in a friendlier format
Function WMIDateStringToDate(utcDate)
WMIDateStringToDate = CDate(Mid(utcDate, 5, 2) & "/" & _
Mid(utcDate, 7, 2) & "/" & _
Left(utcDate, 4) & " " & _
Mid (utcDate, 9, 2) & ":" & _
Mid(utcDate, 11, 2) & ":" & _
Mid(utcDate, 13, 2))
End Function
How It Works
One of the first steps you should take when troubleshooting a network connectivity issue is to
get a snapshot of your computer's TCP/IP configuration. Mistyping a default gateway or subnet
mask can create errors that even the most seasoned network professionals can overlook if they
Search WWH ::




Custom Search