PowerShell for Windows Admins

Apr 23 2011   5:34AM GMT

System Stability



Posted by: Richard Siddaway
Security

As admins one of the things we need to be able to prove is the stability and reliability of our systems. With Windows 7 and Windows 2008 R2 we have a way to do this

001
002
003
004
005
006
007
008
009
010
011
012
function get-stabilityindex {
[CmdletBinding()]
param
 (
 
[parameter(ValueFromPipeline=$true,
   ValueFromPipelineByPropertyName=$true)]
 [string]$computer="."
) 
 
Get-WmiObject -Class Win32_ReliabilityStabilityMetrics
 `
 
-ComputerName $computer |
 select @{N="TimeGenerated"; E={$_.ConvertToDatetime($_.TimeGenerated)}},
 
 
SystemStabilityIndex
}

Use the Win32_ReliabilityStabilityMetrics class – see http://msdn.microsoft.com/en-us/library/ee706632(VS.85).aspx for details

The function takes a computer name and returns the date and time a metric was computed and its value.

We’ll follow this up with a look at Win32_Reliability records next time

Comment on this Post

Leave a comment: