All posts tagged SQL

If you want to find out what objects are currently in Maintenance Mode, here’s a nice bit of SQL Code you can use for just that. I’ve added a more useful English Reason than just the code because SCOM stores the code itself in the Database. It’s a lot easier in my opinion to identify the reason as server was put into maintenance that just code 8 or 9.

Here it is, enjoy.

Read more

There’s a lot of ways we can retrieve a list of alerts from SCOM, but nothings quicker than going to the Database directly. So here’s a bit of SQL that can grab all alerts from a Management Server, but formats the output a bit nicer. So for example rather than outputting the severity as a 0, 1 or 2…it outputs the english word, Informational, Warning or Critical. Same with the Monitor or Rule. Just a bit easier to read than working out if a 0 or a 1 is a monitor or rule.

Read more

So have you ever wondered what happens when you run a PowerShell command against your SCOM environment? Of course you have or you wouldn’t be here. Well you probably wouldn’t be surprised to learn that behind the scenes a lot of PowerShell cmdlets are really only performing a SQL query against your SCOM Databases.

Read more

Although directly editing the SCOM Databases isn’t something that Microsoft really support, we all know that accessing the SCOM Databases directly can be easier than mucking around in the console or trying to use or find a suitable PowerShell cmdlet. As much as I love using PowerShell wherever possible, I know that there are times that I just go to SQL Management Studio to directly query the OperationsManager Database because it can often be a lot quicker to get at the desired information.

Read more