Retrieving Service Level Object IDs in SCOM using PowerShell

If you need to extract the Service Level Object IDs from SCOM there is now built in Powershel command to retrieve this. But you can combine different commands to get the same result.

Introduction

In System Center Operations Manager (SCOM), there may be instances where you need to retrieve the IDs of your Service Level Tracking Objects. Currently, there is no built-in PowerShell command to directly achieve this. However, it's possible to combine different commands to get the desired result.

Resolution

To extract the Service Level Object IDs, you will need to execute a specific code on a computer where the Operations Manager SDK is available. This involves using PowerShell to access the SCOM SDK and retrieve the information.

Execute the following code:
Powershell

(Get-ScomManagementGroup).ServiceLevelAgreements.GetType().GetMethod("GetServiceLevelObjectives", [Type[]]@()).MakeGenericMethod([Microsoft.EnterpriseManagement.Configuration.ManagementPackSLO]).Invoke((Get-ScomManagementGroup).ServiceLevelAgreements)

Steps:

  1. Open PowerShell with administrative privileges on a machine where the Operations Manager SDK is installed.
  2. Copy and paste the provided code into the PowerShell window.
  3. Press Enter to execute the code.

This script utilizes the SCOM SDK to access the ServiceLevelAgreements object and then invokes the GetServiceLevelObjectives method to retrieve the IDs of the Service Level Tracking Objects.

Expected Results

After running the script, it will return the IDs of all the Service Level Tracking Objects in your SCOM environment. These IDs can be used for further administrative tasks or tracking purposes within SCOM.

Additional Information

  • Ensure that the Operations Manager SDK is correctly installed and configured on the computer where you execute this script.
  • The script must be run with administrative privileges to access the necessary SCOM resources.
  • The output will only include the IDs of the Service Level Tracking Objects. If additional information about these objects is needed, further scripting and commands may be required.