I am creating a Powershell script that gets the effective override state for a class instance and a monitor, and I am trying to use the Get-SCOMOverrideResult cmdlet to provide this.
In order to test this, I created a some test overrides and scoped some to the class, and one to a specific object.
The monitor in question is "Windows Server 2012 Max API Monitor", and the server is, say serverxzy.domain.com
So I created overrides like so:
For all objects of the class Microsoft.Windows.Server.6.2.OperatingSystem:
a. AlertSeverity override to Warning
b. AlertOnState override to Warning
For serverxyz.domain.com:
a. AutoResolve set to False
When I use Override Explorer, I can view all three effective settings when I look at serverxyz, but when I run Powershell I don't see the correct values. Here's my example code:
$class = Get-SCOMClass -Name Microsoft.Windows.Server.6.2.OperatingSystem
$testobject = Get-SCOMClassInstance | where { $_.Path -eq "serverxyz.domain.com" }
$testmonitor = Get-SCOMMonitor -Id 446af50e-d06e-a754-1a5f-1e6c8bee1af6
$results = Get-SCOMOverrideResult -Instance $testobject -monitor $testmonitor
---
Now, to me I would expect to see the output of the three settings I have set with my overrides, but instead my output looks like:
TargetName WorkflowName PropertyName Value
---------- ------------ ------------ -----
Microsoft Windows Server 2012 R2 S... Windows Server 2012 Max Concurrent... AlertSeverity Warning
Microsoft Windows Server 2012 R2 S... Windows Server 2012 Max Concurrent... AlertSeverity Warning
Microsoft Windows Server 2012 R2 S... Windows Server 2012 Max Concurrent... AlertSeverity Warning
---
So that looks like just the AlertSeverity override three times. This seems to be exactly the same result each time. $results[0] -eq $results[1] return $true, for example. Drilling in even more, $results[0].Override.Value.EffectiveOverride.Id and $results[1].Override.Value.EffectiveOverride.Id return the exact same override guid.
Any idea if I'm missing something? Like I said, the three override values show up properly in Override Explorer, and Get-SCOMOverride -Monitor $testmonitor returns all three values. So in theory I could get the results of Get-SCOMOverride and then check all of the classes, objects, groups, etc to see if my monitoringobject is a member, but that seems like a lot of work that Get-SCOMOverrideResult is supposed to do for me automatically.
Any nudge in the right direction would be appreciated!
-Steve