Pages

Get remote MAC address

Sunday 25 May 2014
code:
On error resume next
strComputer = (InputBox("Enter the name of the computer to get the MAC address", "Computer Name"))
If strComputer <> "" Then
strInput = True
End if
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objItem in colItems
Wscript.Echo objItem.MACAddress

Next

No comments:

Post a Comment