question

DD-6838 avatar image
0 Votes"
DD-6838 asked GeorgeMoise-0315 answered

How to export all rules and monitors from SCOM 2007 management group

Hello,

How can I export all rules and monitors from SCOM 2007. I use the powershell script from Kevin Holman to export all rules and monitors from SCOM 2019 but for 2007 its powershell v1 and the script cannot be used. I used to do it in the past but I forgot how it was done. Was there a SQL query or any other way . I need to export all rules and monitors to CSV from a 2007 management group.

msc-operations-manager
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndrewBlumhardt-1137 avatar image
0 Votes"
AndrewBlumhardt-1137 answered AndrewBlumhardt-1137 edited

Only unsealed MPs can be exported as complete MP files if your goal is a restorable backup. In that case you need to maintain a copy of your original MP files. Old versions may not be available for download when you need them.

It was something like Get-SCOMManagementPack | Export-SCOMManagementpack -Path "C:\Management Packs". Though the commands have changed since then. Try using help or dropping the "SCOM" from the commands above. Only the unsealed files created will be importable.

There should be a PowerShell command if you simply want to create a CSV listing. Get-SCOMMonitor | Export-Csv -Path Monitors.csv




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DD-6838 avatar image
0 Votes"
DD-6838 answered

Thank you Andrew !

get-monitor and get-rule are both commands. That's good but do you remember if there was a nice powershell script which created the CSV report for you shows which rule or monitor to which management pack belongs ? Was there something better besides these two commands ?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndrewBlumhardt-1137 avatar image
0 Votes"
AndrewBlumhardt-1137 answered

Not that I recall but maybe someone else here remembers. :-)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CyrAz avatar image
0 Votes"
CyrAz answered

It should be fairly easy to adapt Kevin's script you mention in first post...

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GeorgeMoise-0315 avatar image
0 Votes"
GeorgeMoise-0315 answered

Hi @DD-6838,

If you want to get just some basic details about Monitors and Rules, you could also try with the following SQL Queries (I don't remember if anything was changed in the Schema of these tables since 2007):

Monitors:
select m.MonitorName, m.MonitorCategory,m.AlertSeverity, lt.LanguageCode,lt.LTValue,mp.MPFriendlyName as MPName, MP.MPVersion from Monitor m
Inner join LocalizedText LT on LT.ElementName = m.MonitorName
Inner join ManagementPack mp on m.ManagementPackId = mp.ManagementPackId
where lt.LanguageCode = 'ENU'


Rules:
Select R.RuleName, R.RuleCategory, LT.LTValue, MP.MPFriendlyName, MP.MPVersion from Rules R
Inner join LocalizedText LT on LT.ElementName = R.RuleName
Inner join ManagementPack MP on R.ManagementPackId = MP.ManagementPackId
Where LT.LanguageCode = 'ENU'


I hope it helps!
BR,
George




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.