Monday, November 21, 2011

Tips: How to get the reliability data from the remote PCs using Windows PowerShell 2.0

Most of us still use Windows Vista as we feel bad or struggle with Windows 7. If you are such a user, this article will be one of the most useful. By default, Windows Vista has come out with the Reliability Monitor. It is used to access the system ability data from the Reliability Analysis Component (RAC) database in a graphical manner. Moreover, this tool lets you view the system stability trend and associated events that might have affected that stability. However, in Windows 7, you can access the RAC database via WMI and to make the IT pros view and use the data more flexibly. As Windows 7 has come out with Windows PowerShell 2.0, you can have the remote scripting capabilities comprising access to WMI. By combining these technologies, you can get the reliability data from user systems without having to physically visit their offices. Check out the following commands.

get-wmiobject Win32_ReliabilityRecords -computername 127.0.0.1 -property Message |
select-object -first 5 Message |
format-list *

Distribution of reliability events:
get-wmiobject Win32_ReliabilityRecords -property @("SourceName", "EventIdentifier") |
group-object -property SourceName,EventIdentifier -noelement |
sort-object -descending Count |
select-object Count,Name |
format-table *

The latest stability index for multiple machines:
@("USER-PC-1", "USER-PC-2") |
foreach-object -process {
get-wmiobject Win32_ReliabilityStabilityMetrics -computername $_ -property @("__SERVER", "SystemStabilityIndex") |
select-object -first 1 __SERVER,SystemStabilityIndex |
format-table
}

 

 

View a graphical display of the stability index:
get-wmiobject Win32_ReliabilityStabilityMetrics -property @("SystemStabilityIndex","EndMeasurementDate") |
foreach-object -process {
$t = "";
for ($i = 0; $i -le $_.SystemStabilityIndex * 5; $i++) { $t = $t + "=" };
$_.EndMeasurementDate + " " + $t
}

B  y , , ,