How do you use cloud databases? Take the survey.

Get-SQLMonitorGroup doesn't do what one would expect.

I have three groups, Staging, Development and Production

Your documentation says this....
 
<div>&nbsp; -------------------------- EXAMPLE 1 --------------------------</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; PS C:\>Get-SqlMonitorGroup -Path 'Production', 'Accounting'<br></div>

if I do this in PowerShell...
Get-SQLMonitorGroup -path 'Staging','production','Development'

....I get this
<div>Failed to find group "Staging"</div><div>At C:\Program Files\WindowsPowerShell\Modules\RedgateSQM\RedgateSQM.psm1:736 char:9</div><div>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;throw "Failed to find group ""$($Path[0])""";</div><div>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</div><div>&nbsp; &nbsp; + CategoryInfo&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : OperationStopped: (Failed to find group "Staging":String) [], RuntimeException</div><div>&nbsp; &nbsp; + FullyQualifiedErrorId : Failed to find group "Staging"</div>
when I feed the parameters in one at a time interactively the same thing happens. How do I get the groups as MonitoredObjects

Best Answer

  • Phil_Fact0rPhil_Fact0r Posts: 20 Bronze 3
    I'll answer my own question about how to get a group. There is another Cmdlet called Get-SQLMonitorMainGroups that seems to do what I want. One then gets subgroups using Get-SqlMonitorSubGroups. I'm still mystified about what Get-SQLMonitorGroup does.
Sign In or Register to comment.