How to Find Model of Multiple PC's?
Posted by Dwonathon@reddit | sysadmin | View on Reddit | 13 comments
Hey guys,
I was tasked with finding the models of about ~100 PC's in our organization and I'm looking for an easier method than what I was/am planning on doing.
My only idea would take a pretty long time. We use LogMeIn, so essentially I would remote into every PC one by one, and use the command prompt in the background to use "wmic csproduct get name" and type their model, along with PC name into an Excel sheet.
You could see how that could take a while.
Do you guys know of any other free methods?
We use a DC, so I was hoping to find a powershell script that might get that info and export it into a .txt file or something but wasnt having any luck with what I found.
Which was using this:
> $WindowsComputers = (Get-ADComputer -Filter * | Select-Object -ExpandProperty Name) | Sort-Object
foreach ($computerName in $WindowsComputers) {
Get-WmiObject -Class Win32_ComputerSystem -ComputerName $computerName | Select-Object Name, Manufacturer, Model | Out-File -Append -FilePath "$HOME\Desktop\Model Log.txt"
}
But got this error a bunch:
> Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
At line:2 char:5
+ Get-WmiObject -Class Win32_ComputerSystem -ComputerName $computer ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-WmiObject], COMException
+ FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
But I am open to whatever might work. Keep in mind I am pretty new at this position and unfortunately don't have much help here at the office.
Thanks a bunch!
13 Comments
juskom95@reddit
Dwonathon@reddit (OP)
juskom95@reddit
Dwonathon@reddit (OP)
juskom95@reddit
Dwonathon@reddit (OP)
Background-Look-63@reddit
juskom95@reddit
GeneMoody-Action1@reddit
mfinnigan@reddit
Verisimillidude@reddit
Parlett316@reddit
Dwonathon@reddit (OP)