Powershell – Find Serial Numbers on MININT Computers in Active Directory
Find MININT computers and retrieve their service tag / serial numbers.
# get list of MININT* computers
$Computers = Get-ADComputer -Filter "Name -like 'MININT*'"
# get serial numbers for each computer
ForEach ($x in $Computers) {
$colItems = Get-WmiObject Win32_BIOS -Namespace “root\CIMV2" -computername $x.DNSHostName -ErrorAction SilentlyContinue
if ($colItems -ne $null) {
ForEach($objItem in $colItems) {
Write-Host $x.Name "=" $objItem.SerialNumber
}
}
}