WMI script

G

Guest

I have a script which allows you to enter a hostname and it would return the
MAC address of that computer. How do I modify it so that I could enter a
MACAddress and have it return the hostname or logon username? Appreciate any
help, thanks.

strComputerName = InputBox("Enter the name of the computer you wish to query")
strWinMgt = "winmgmts://" & strComputerName &""
Set IPConfigSet = GetObject (strWinMgt).ExecQuery("select MACAddress,
DNSHostname from Win32_NetworkAdapterConfiguration")
for each IPConfig in IPConfigSet
WScript.Echo "MACAddress: " & IPConfig.MACAddress
next
 
D

David H. Lipman

From: "UWKC Admin" <[email protected]>

| I have a script which allows you to enter a hostname and it would return the
| MAC address of that computer. How do I modify it so that I could enter a
| MACAddress and have it return the hostname or logon username? Appreciate any
| help, thanks.
|
| strComputerName = InputBox("Enter the name of the computer you wish to query")
| strWinMgt = "winmgmts://" & strComputerName &""
| Set IPConfigSet = GetObject (strWinMgt).ExecQuery("select MACAddress,
| DNSHostname from Win32_NetworkAdapterConfiguration")
| for each IPConfig in IPConfigSet
| WScript.Echo "MACAddress: " & IPConfig.MACAddress
| next
|

Hereis a good place to start...
microsoft.public.win32.programmer.wmi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top