Posts: 16
Joined: 17.Aug.2005
From: china
Status: offline
I have finished writting a AppFilter and want to sell it. I want to get the ISA Server's MAC Address as it's id. And check whether the AppFilter has registered. But I have a problem with getting ISA Server's MAC Address. Who can tell me how to get it?
Posts: 2187
Joined: 10.Aug.2004
From: fort frances.on.ca
Status: offline
WMI will do it for you. Here is a script I have that returns the MAC and more.
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:" & "!\\" & strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objAdapter in colAdapters
Wscript.Echo "Host name: " & objAdapter.DNSHostName
Wscript.Echo "DNS domain: " & objAdapter.DNSDomain
Wscript.Echo "DNS suffix search list: " & objAdapter.DNSDomainSuffixSearchOrder
Wscript.Echo "Description: " & objAdapter.Description
Wscript.Echo "Physical address: " & objAdapter.MACAddress
Wscript.Echo "DHCP enabled: " & objAdapter.DHCPEnabled
If Not IsNull(objAdapter.IPAddress) Then
For i = LBound(objAdapter.IPAddress) To UBound(objAdapter.IPAddress)
Wscript.Echo "IP address: " & objAdapter.IPAddress(i)
Next
End If
If Not IsNull(objAdapter.IPSubnet) Then
For i = LBound(objAdapter.IPSubnet) To UBound(objAdapter.IPSubnet)
Wscript.Echo "Subnet: " & objAdapter.IPSubnet(i)
Next
End If
If Not IsNull(objAdapter.DefaultIPGateway) Then
For i = LBound(objAdapter.DefaultIPGateway) To UBound(objAdapter.DefaultIPGateway)
Wscript.Echo "Default gateway: " & objAdapter.DefaultIPGateway(i)
Next
End If
Wscript.Echo "DHCP server: " & objAdapter.DHCPServer
If Not IsNull(objAdapter.DNSServerSearchOrder) Then
For i = LBound(objAdapter.DNSServerSearchOrder) To UBound(objAdapter.DNSServerSearchOrder)
Wscript.Echo "DNS server: " & objAdapter.DNSServerSearchOrder(i)
Next
End If
Wscript.Echo "Primary WINS server: " & objAdapter.WINSPrimaryServer
Wscript.Echo "Secondary WINS server: " & objAdapter.WINSSecondaryServer
Wscript.Echo "Lease obtained: " & objAdapter.DHCPLeaseObtained
Wscript.Echo "Lease expires: " & objAdapter.DHCPLeaseExpires
Next
< Message edited by LLigetfa -- 24.Nov.2005 4:46:48 AM >
_____________________________
The School of Hard Knocks is a mean teacher. She gives the exam before the lesson.