I want to get serial numbers of remote PC's with the name of PC, in one table. $PCNameArray is array of remote PC I want to get serial numbers.
$complete = $false
$arrayJobs = @()
Foreach($a in $PCNameArray) {
$arrayJobs += Get-WmiObject -ComputerName $a -Class Win32_BIOS -asjob
}
while (-not $complete) {
$arrayJobsInProgress = $arrayJobs |
Where-Object { $_.State -match ‘running’ }
if (-not $arrayJobsInProgress) { “All Jobs Have Completed” ; $complete = $true }
}
$arrayJobs | Receive-Job
this code will give me only serial numbers. How can I add each PC names to this result? Thank you.