Author: Scott Moss

SCOM 2007 PowerShell cmdlet: Resolve-Alert

The Resolve-Alert commandlet resolves open alerts. In order to utilize the Resolve-Alert commandlet, you will need to get some unresolved alerts, by using the get-alert commandlet. Here is an example of the Resolve-Alert commandlet in action. get-alert -criteria ‘LastModified >= ”3/13/2008” AND ResolutionState = ”0” AND Category = ”Alert”’| resolv...

Operations Manager 2007: Get-Alert PowerShell Commandlet

The get-alert commandlet has several parameters available for filtering its output. The examples below will only use the –criteria parameter. I’m using the measure-object commandlet to show some output, it’s not practical to display 4 or 5 pages of alerts per example. The alerts can just as easily be piped to the convert-csv commandlet or displayed to the screen. To show all alerts for Computer AD...

Troubleshoot script errors or WMI errors in Windows 2008

One obstacle to troubleshooting OpsMgr script errors or WMI query errors in Windows 2008, is to run the script or WMI query as a local system account in an interactive session so that you can see the output from the script. To do this you will need to download PsTools, and use the psexec.exe file. http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx  Command line (that is a Zero befo...

OpsMgr 2007 – SQL Query for Alert Information

Here’s a requested a SQL query for SCOM to get the following information: Managed computer, Alert description and Alert severity. I wrote the following SQL query to do that only instead of getting the Managed Computer name I use the MonitoringObjectDisplayName. I should be able to figure out how to get this same information from a PowerShell one liner too. — Scott Moss — SCOM 2007 SP1 ...

SCOM 2007 PowerShell Get-Agent Commandlet

Operations Manager 2007 PowerShell commandlets are very very powerful. I’ve only scraped the surface of what they can do with these very simple examples. 1. Get a list of agent managed machine names. >get-agent | format-list *displayname 2. Get a list of agent managed machine names and thier ip address: >get-agent | format-list -property, displayname, IPAddress DisplayName : SERVERNAME...

More get-alert IsMonitorAlert PowerShell one liners for SCOM

Here are some more handy PowerShell one liners that will get a count, a report or resolve alerts that were generated by rules in their various Severity states, informational, warning, and critical. The final one liner closes all alerts generated by rules. Get a count of informational alerts created by a rule —————————————...

  • 1
  • 2