SID-500

Home » PowerShell » PowerShell: Documenting your environment by running systeminfo on all Domain-Computers

PowerShell: Documenting your environment by running systeminfo on all Domain-Computers

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

Unbenannt.PNG

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

Unbenannt.PNG

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.

Unbenannt1.PNG

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.

Unbenannt3.PNG

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

Unbenannt.PNG

Perfect, beautiful. 😉

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)

 


4 Comments

  1. […] For documenting your environment see: PowerShell: Documenting your environment by running systeminfo on all Domain-Computers […]

    Like

  2. […] For documenting your environment see: PowerShell: Documenting your environment by running systeminfo on all Domain-Computers […]

    Like

  3. […] PowerShell: Documenting your environment by running systeminfo on all Domain-Computers […]

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

WHOIS

My name is Patrick Grünauer (pewa2303). I am from Austria. On sid-500 I write about Windows, Cisco and IT-Security in English and German. Have fun while reading!

Patrick Gruenauer
Follow SID-500 on WordPress.com