PowerShell Script To Return A Remote Machines MAC And IP Address

 

This PowerShell script will prompt you for a remote machine name and return the MAC address and The IP address for the machine

 

PS1 Script:

 

Clear

$strComputer = Read-Host "Enter Machine Name"

Clear

 

$colItems = GWMI -cl "Win32_NetworkAdapterConfiguration" -name "root\CimV2" `

-comp $strComputer -filter "IpEnabled = TRUE"

 

ForEach ($objItem in $colItems)

{Write-Host "Machine Name: " $strComputer

Write-Host "MAC Address: " $objItem.MacAddress

Write-Host "IP Address: " $objItem.IpAddress}

 

Published Sunday, April 29, 2007 11:43 AM by dhite
Filed under:

Comments

# SMS Exclusions By MAC Address

In SMS 2003 as well as SMS 2.0 you can exclude resources from being discovered by adding the machine

Sunday, August 12, 2007 9:10 AM by Don Hite