This article only applies to Squared Up Version 2.0. If you're looking for help with Squared Up Version 3.0, please visit our new knowledge base

Here are a few SCOM Powershell commands that might come in useful.  Just replace the ID here with the ID of the object you are interested in.


How to open SCOM Powershell:

Click Start, click All Programs (or click the arrow for more applications), within Microsoft System Center 2012, Operations Manager, click Operations Manager Shell.


1. Scope Criteria

The Scope Criteria needs to use the SCOM internal name of the property, rather than the display name.


To get a full list you can run the following Powershell script:


Get-SCOMClassInstance -Name "hostname.dnsdomain" | Format-List

Replacing hostname.dnsdomain with your details, for example, server1.mydomain.local

There is no need to qualify the property with the type name such as [Microsoft.Windows.Computer]

 

2. To query the RuleId when using the Server KPI plugin:

Get-SCOMRule -Id b603ba1e-c5ec-221e-e9e3-cf2098e7bdbd | Format-List

 

3. To query the MonitorId :

Get-SCOMMonitor -Id 32c755df-94b4-5f2e-62b7-0fef16758699 | Format-List

 

3. To get details such as the DisplayName of an Object:

Get-SCOMMonitoringObject -Id 6f7e3306-beeb-2996-3795-7c1eafb925b8 | Format-List

 

or

 

get-scomclass -id 2c2de865-0cd3-a6b8-51a5-3dabf7b48d4e | Format-List

If the object exists a list of information will be returned.  If the object does not exist nothing will be returned.

 

4. To get details of a group:

Get-SCOMGroup -Id d0720ebb-670a-3586-9d1c-a10246489de4



How to find the SCOM ID of an object or group

You can use SCOM Powershell commands to find the SCOM ID of objects and groups as shown below, or you can very easily find the SCOM IDs in Squared Up, see How to find the SCOM ID of an object or group

Get-SCOMMonitoringObject -DisplayName "Hong Kong" | select id

This can be used for any object (or group).


or to list all groups and their SCOM IDs:

Get-SCOMGroup | select displayName,Id


See also:

How to find the SCOM ID of an SLO