How to get MAC Addresses from remote computers

When working with installation systems or other Network systems
you often need your users MAC Address.

You can ask the users to start cmd.exe and then do a ipconfig.exe /all.
If you have 100-5000 users this can be a whole year of work :)

Or you can open up powershell and use this little script:


 
$strComputer = "."

$colItems = get-wmiobject -class "Win32_NetworkAdapterConfiguration" -computername $strComputer |Where{$_.IpEnabled -Match "True"}

foreach ($objItem in $colItems) {

$objItem |select Description,MACAddress

}

Combine this script with a Active Directory script that will show all of your

computers and then Export it to a csv file and you have a good import file!

 

No related posts.

This entry was posted in PowerShell Blogs and tagged , , . Bookmark the permalink.

0 Responses to How to get MAC Addresses from remote computers

  1. Fredrik Wall says:

    New blog post about getting MAC Addresses from remote computers, http://tinyurl.com/nqo8j9

  2. Shay Levy says:

    Here’s another way using server side query:

    Get-WMIObject Win32_NetworkAdapterConfiguration -computerName $strComputer -filter “IPEnabled=’True’” | select __SERVER,Description,MACAddress

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>