W2KSG: Retrieving System Information

I am going to jump on a bit in the Scripting Guide and skip to chapter 8 - Computer Assets.  (Chapter 7 is working with AD which we will return to later). Chapter 8 uses WMI to work with your computer systems.  In these examples we are working with the local machine but we can use the computername parameter to work with remote machines.

The section of the Scripting Guide we are dealing with can be found at

Script Center Home > Microsoft Windows 2000 Scripting Guide > Scripting Solutions for System Administration > Computer Assets > Computer Assets Overview  Retrieving System Information

Lisiting 8.1

"Operating System"
Get-WmiObject -Class Win32_OperatingSystem | Select Name, Version,ServicePackMajorVersion, ServicePackMinorVersion, Manufacturer, WindowsDirectory, Locale, FreePhysicalMemory, TotalVirtualMemorySize, FreeVirtualMemory | Format-List

"Computer System"
Get-WmiObject -Class Win32_ComputerSystem | Select Name, Manufacturer, Model, CurrentTimeZone, TotalPhysicalmemory | Format-List

"Processor"
Get-WmiObject -Class Win32_Processor | Select Architecture, Description | Format-List

"Bios"
Get-WmiObject -Class Win32_Bios | Select Version | Format-List

We can use WMI to retrieve information on the Operating System, Computer, processor and Bios.  Each of these WMI classes has a host of other information.  Investigate the options and you can easily generate a script to document your systems. Note I have used 4 lines of PowerShell to duplicate the 33 lines on VBScript in the Guide's example.

 

Share this post :

 

Technorati Tags: ,

Leave a Reply