Help! What I have have been assigned to do is collect mac addresses from over 300 NAS servers on our company network, now I know I can use the below script to get a MAC of a local machne but I can't get it to work reading a text file with all the server names and output to an excel file with the hostname and mac address.
Hope some one can help, sorry if this is in the wrong area.
Paul
Sub PrintMacAddress
Dim strComputer
strComputer = "."
Dim objWMIService
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Dim colAdaptors
Set colAdapters = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
Dim n
n = 1
For Each objAdapter In colAdapters
Rhino.Print ""
Rhino.Print "Network Adapter " & n
Rhino.Print " Description: " & objAdapter.Description
Rhino.Print " Physical (MAC) address: " & objAdapter.MACAddress
n = n + 1
Next
End Sub
Hope some one can help, sorry if this is in the wrong area.
Paul
Sub PrintMacAddress
Dim strComputer
strComputer = "."
Dim objWMIService
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Dim colAdaptors
Set colAdapters = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
Dim n
n = 1
For Each objAdapter In colAdapters
Rhino.Print ""
Rhino.Print "Network Adapter " & n
Rhino.Print " Description: " & objAdapter.Description
Rhino.Print " Physical (MAC) address: " & objAdapter.MACAddress
n = n + 1
Next
End Sub