Systeminfo gives you a perfect overview of your system. But what about the other systems in your domain? Sure, you can use 3rd Party Tools or SCCM. But the number of those who can´t use enterprise software is greater than you think. In this article I am going to describe how to run systeminfo on all Client Computer without using 3rd Party Tools.
What is systeminfo?
Open PowerShell. Type systeminfo.
systeminfo
Next, the goal is to get that useful information for all Domain Computers.
Running systeminfo on all Domain Computers
Log on to the domain as a Member of the Domain Admins Group. Run the following command:
(Get-ADComputer -Filter *).Name | Foreach-Object {Invoke-Command -ComputerName $_ {systeminfo /FO CSV}} | ConvertFrom-Csv | Out-GridView
This will give you a perfect overview of your environment. But we are faced with two problems. Those red one’s are not good one’s 😉
Problem 1
If you get an error, then one of your workstations or servers isn´t responding. The reason can be manifold. The computer might be switched off.
To avoid this, run Foreach-Object with the parameter -ErrorAction SilentlyContinue.
(Get-ADComputer -Filter *).Name | Foreach-Object {Invoke-Command -ComputerName $_ {systeminfo /FO CSV} -ErrorAction SilentlyContinue} | ConvertFrom-Csv | Out-GridView
Problem 2
Now let´s solve the next problem. Let´s remove the annoying Header Lines. We want only one header for all computers.
To remove the multiple headers run
(Get-ADComputer -Filter *).Name | Foreach-Object {Invoke-Command -ComputerName $_ {systeminfo /FO CSV} -ErrorAction SilentlyContinue | Select-Object -Skip 1} | ConvertFrom-Csv -Header "Host Name","OS","Version","Manufacturer","Configuration","Build Type","Registered Owner","Registered Organization","Product ID","Install Date","Boot Time","System Manufacturer","Model","Type","Processor","Bios","Windows Directory","System Directory","Boot Device","Language","Keyboard","Time Zone","Total Physical Memory","Available Physical Memory","Virtual Memory","Virtual Memory Available","Virtual Memory in Use","Page File","Domain","Logon Server","Hotfix","Network Card","Hyper-V" | Out-GridView
Perfect. 😉
Have fun documenting your systems.
See also
PowerShell: Force gpupdate on all Domain Computers
Restart all Domain Computers by using PowerShell
PowerShell: Enable Remote Desktop on multiple Servers remotely (Bulk)
Categories: PowerShell, Windows Server
Any change this can be filtered to retrieve serialnumbers of computers in just an OU.
LikeLike
Hey,
thanks for your work, but its not working. it give the detail of current computer only.
Regards
LikeLike
The code retrieves all computer accounts from the entire domain. WinRM has to be enabled on all client OS. Check prerequisites on remoting.
LikeLike
I’m trying to write a PS scripts to collect information where i can point to a txt or csv file to extract a list of computers, then the outcomes are digested into a single file.
LikeLiked by 1 person