Monthly Archives: September 2008

PowerShell in Practice

Chapter 5 – user accounts (local and AD) is now available on MEAP – http://www.manning.com/siddaway/   Share this post :   Technorati Tags: PowerShell  

Posted in Powershell | Leave a comment

W2KSG: Service Pack

Continuing our look at Operating Systems – what about Service Pack information Listing 8.8 Get-WmiObject -Class Win32_OperatingSystem | Format-List ServicePackMajorVersion, ServicePackMinorVersion In this one I’m using Format-List to perform the selection as well as the display.  We could make it … Continue reading

Posted in PowerShell and WMI | Leave a comment

W2KSG: Operating System

The other area we have to dig into when inventorying systems is the OS.  WMI has a class just for this PS> Get-WmiObject -Class Win32_OperatingSystem SystemDirectory : C:Windowssystem32Organization    :BuildNumber     : 6001RegisteredUser  : adminSerialNumber    : 55041-037-8508545-71489Version         : 6.0.6001 This doesn’t give … Continue reading

Posted in PowerShell and WMI | Leave a comment

W2KSG: Inventory Hardware

Most of the hardware connected to your system has a matching WMI class – cd, sound, keyboard, network adapter, printers and usb for example.  To find the appropriate WMI classes use Get-WmiObject -List *networkadapter Or similar If you want to … Continue reading

Posted in PowerShell and WMI | Leave a comment

W2KSG: BIOS Information

Previously we looked at retrieving computer system information using WMI.  We looked at the BIOS information in passing.  There is a lot more information held in the BIOS Listing 8.2 Get-WmiObject -Class Win32_Bios | Select -Property BuildNumber, CurrentLanguage, InstallableLanguages, Manufacturer, … Continue reading

Posted in PowerShell and WMI | Leave a comment

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 … Continue reading

Posted in PowerShell and WMI | Leave a comment

PowerShell reading SQL Server logs

Thanks to Dmitry – http://dmitrysotnikov.wordpress.com/2008/09/26/more-sql-cmdlets/ –  and Jacob – http://mspowershell.blogspot.com/2008/09/read-transactionlog-of-sql-server-from.html – for pointing out the PowerShell cmdlets in Quest’s SQL Lite Speed.  You can read the transaction log!! Download a trial version from http://www.quest.com/litespeed-for-sql-server/   Share this post :   … Continue reading

Posted in PowerShell and SQL Server | Leave a comment

W2KSG: Folders Creation date

WMI has a class Win32_Directory for working with folders on a machine. We can use this class to find all folders created this month. Listing 6.22 $d = "’" + (Get-WmiObject -Class Win32_Directory -Filter "name=’c:\’").ConvertFromdateTime([datetime]"09/01/2008") + "’"Get-WmiObject -Class Win32_Directory -Filter … Continue reading

Posted in PowerShell and WMI | Leave a comment

W2KSG: Time Zones

The WMI section of the scripting guide gives a very simple method of determining the time zone on your machine Listing 6.20 Get-WmiObject Win32_TimeZone | Format-List Bias      : 0SettingID : Caption   : (GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, … Continue reading

Posted in PowerShell and WMI | Leave a comment

PowerShell poll

Sapien are running a poll – http://blog.sapien.com/index.php/2008/09/23/powershell-production-poll/ – asking if you are using PowerShell in production.  It may be a self selecting group that is answering but the results are interesting and pleasing   Share this post :   Technorati … Continue reading

Posted in Powershell | Leave a comment