Hey
Here is a PowerShell script that works for us. Note that the devices must all be on the LAN, as it uses WMI/CIS instances to grab the data.
Place all of the computer names in a CSV file with the header "AssetTag", and change the path in the script.
$Assets = Import-CSV -Path ".\input.csv";
$AssetsWithSerialNumber = @();
foreach($Asset in $Assets)
{
$AssetTag = $Asset.AssetTag;
$SerialNumber = (Get-CimInstance -Class Win32_BIOS -ComputerName $AssetTag | Select-Object SerialNumber).SerialNumber;
$AssetWithSerialNumber = [PSCustomObject]@{
AssetTag = $AssetTag
SerialNumber = $SerialNumber
};
$AssetsWithSerialNumber += $AssetWithSerialNumber;
}
$AssetsWithSerialNumber | Export-CSV -Path ".\output.csv" -NoTypeInformation
Edit: If you want to get every AD computer, you should just be able to replace the first line with:
$Assets = Get-ADComputer -Filter * | ft Name and replace any reference to AssetTag with Name.