header image

Archive for September, 2008

PowerShell in Practice

Posted by: | September 30, 2008 | No Comment |

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

under: PowerShell original

W2KSG: Service Pack

Posted by: | September 30, 2008 | No Comment |

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 simpler if we used the -property parameter on get-wmiobject but that also displays the WMI […]

under: PowerShell and WMI

W2KSG: Operating System

Posted by: | September 29, 2008 | No Comment |

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:\Windows\system32Organization    :BuildNumber     : 6001RegisteredUser  : adminSerialNumber    : 55041-037-8508545-71489Version         : 6.0.6001 This doesn’t give us everything we might wish for.  The default formatter is a play here in that […]

under: PowerShell and WMI

W2KSG: Inventory Hardware

Posted by: | September 29, 2008 | No Comment |

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 investigate the pointing devices try Listing 8.4 Get-WmiObject -Class Win32_PointingDevice | Select HardwareType, NumberofButtons, Status, […]

under: PowerShell and WMI

W2KSG: BIOS Information

Posted by: | September 29, 2008 | No Comment |

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, Name, PrimaryBIOS, ReleaseDate, SerialNumber, SMBIOSBIOSVersion, SMBIOSMajorVersion, SMBIOSMinorVersion, SMBIOSPresent, Status, Version, BiosCharacteristics Using the Win32_Bios class […]

under: PowerShell and WMI

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 […]

under: PowerShell and WMI

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 :   Technorati Tags: PowerShell,SQL Server

under: PowerShell and SQL Server

W2KSG: Folders Creation date

Posted by: | September 26, 2008 | No Comment |

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 "CreationDate > $d" | Select Name, CreationDate We start by creating a date in WMI […]

under: PowerShell and WMI

W2KSG: Time Zones

Posted by: | September 25, 2008 | No Comment |

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, London Bias returns the offset from GMT and the caption returns the time zone.  Information […]

under: PowerShell and WMI

PowerShell poll

Posted by: | September 25, 2008 | No Comment |

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 Tags: PowerShell

under: PowerShell original

Older Posts »

Categories