Export (0) Print
Expand All

How to Display Performance Collection Rules

Updated: May 22, 2009

Applies To: Operations Manager 2007 R2, Operations Manager 2007 SP1

To display performance collection rules, use the script in this section. This script works for the majority of monitors. It creates a .csv file with the following columns and can be viewed using Microsoft Office Excel.


Column Description


Contains information about where the performance counter is written

WriteToDB or CollectionPerformanceData

Writes to the Operations Manager database

WriteToDW or CollectPerfDataWarehouse

Writes to the data warehouse


Stores baseline data for a performance counter into the OperationsManager database

To display the performance collection rules present in the management group, run the following script:

function GetPerfCounterName ([String] $configuration) 
$config = [xml] ("<config>" + $configuration + "</config>") 
return ($config.Config.ObjectName + "\" + $config.Config.CounterName) 
function GetFrequency ([String] $configuration) 
$config = [xml] ("<config>" + $configuration + "</config>") 
$frequency = $config.Config.Frequency; 
if($frequency -eq $null) 
$frequency = $config.Config.IntervalSeconds; 
return ($frequency) 
function GetDisplayName($performanceRule) 
if($performanceRule.DisplayName -eq $null) 
return ($performanceRule.Name); 
return ($performanceRule.DisplayName); 
function GetWriteActionNames($performanceRule) 
$writeActions = ""; 
foreach($writeAction in $performanceRule.WriteActionCollection) 
$writeActions += " " + $writeAction.Name; 
return ($writeActions); 
$perf_collection_rules = get-rule -criteria:"Category='PerformanceCollection'" 

$perf_collection_rules | select-object @{name="Type";expression={foreach-object {(Get-MonitoringClass -id:$_.Target.Id).DisplayName}}},@{name="RuleDisplayName";expression={foreach-object {GetDisplayName $_}}} ,@{name="CounterName";expression={foreach-object {GetPerfCounterName $_.DataSourceCollection[0].Configuration}}},@{name="Frequency";expression={foreach-object {GetFrequency $_.DataSourceCollection[0].Configuration}}},@{name="WriteActions";expression={foreach-object {GetWriteActionNames $_}}} | sort Type,RuleDisplayName,CounterName | export-csv "c:\perf_collection_rules.csv" 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft