Getting Serial Number of each computer in a list (Powershell)
31,219
The ComputerName parameter accepts a collecion of names so you can pass the content of the file to it:
$computers = Get-Content c:\pstest\computerlist.txt
Get-wmiobject Win32_Bios -ComputerName $computers | Select-Object __SERVER, SerialNumber
Author by
Admin
Updated on April 18, 2020Comments
-
Admin about 4 years
I would like to get the serial numbers of a list of computers. I have created a powershell script as follows:
$computers = Get-Content c:\pstest\computerlist.txt Get-wmiobject win32_bios | ForEach-Object {$_.serialnumber}
All I get is as follows:
PS C:\pstest> .\pstest01.ps1 R6Z00180
How do I do this ?