Remotely pull Computer Name, Serial Number, Model Name using powershell script from multiple computers.
save computer name in abc.txt and save it to c drive.
save computer name in abc.txt and save it to c drive.
$com = Get-Content C:\abc.txt
foreach($computers in $com){
$sn = Get-WmiObject -Class win32_bios -Computername $computers -EA silentlyContinue
$cn = Get-WmiObject -Class Win32_ComputerSystem -Computername $computers -EA silentlyContinue
Write-Host $sn.SerialNumber, $cn.Name, $cn.Model
}
No comments:
Post a Comment