Alert management operations for Microsoft System Center Operations Manager 2012

This topic describes the adapter requests and responses for the following Alert management operations.

Find Alert History

The Find Alert History operation retrieves alert history that is filtered by the specified search criterion. 

The following table describes the adapter request elements for the Find Alert History operation.

Adapter request elements for the Find Alert History operation

ElementDefinitionRequired

<operation-name>

Specifies the operation name: Get-SCOMAlerthistory

Yes

<command-request>

Specifies the parent element for the command elements

Yes

<timeout-secs>

Specifies the duration after which the operation times out 

Default value: 60 seconds

No

<command-parameters>

Specifies the parent element for the command parameters

Yes

<alert>

Specifies the parent element that contains the search criterion used to retrieve a set of alerts

Yes

<alert-search-criteria>

Specifies the parent element for defining the search criterion

Yes

<criteria-expression>

Specifies the parent element for a single search criterion 

You can specify more than one filter criterion by using multiple <criteria-expression> elements.

Yes

<key>

Specifies the alert attribute used in the search 

Valid values: Any valid alert attribute. 

For example, name, description, and ID. 

Note: You can use the find-alert-by-id operation to retrieve all the available alert attributes.

Yes

<value>

Specifies the value of the attribute specified in the <key> element

Yes

<operator>

Specifies an operator

  • If you specify this element under the <alert-search-criteria> element, it specifies the operator between multiple <criteria-expression> elements. 

    Valid values: and, or
  • If you specify this element under the <criteria-expression> element, it specifies the operator for <key> and <value> elements. 

    Valid values: equals, not equals, like, greater than, less than, in (to be used when the ID is used as a key)
 

 

For more information about writing regular expressions, see Regular Expressions in Microsoft System Center Operations Manager documentation .

The following figure shows the <items> XML for the Find Alert History operation.

<items> XML for the Find Alert History operation

<items>
   <item>
      <timeout-secs>120</timeout-secs>
      <command-parameters>
         <alert>
	       <alert-search-criteria>
		     <criteria-expression>
			   <key>Name</key>
			   <value>Health Service Heartbeat Failure</value>
			   <operator>like</operator>
			</criteria-expression>
            </alert-search-criteria> 
         </alert>
      </command-parameters>
   </item>
</items>

The following figure shows the sample adapter request.

Sample adapter request for the Find Alert History operation

<request-data>
  <scom-request>
    <operation-name>Get-SCOMAlertHistory</operation-name>
    <command-request>
      <timeout-secs>120</timeout-secs>
      <command-parameters>
        <alert>
          <alert-search-criteria>
            <criteria-expression>
              <key>ID</key>
              <value>0B3AD3D6-7F2C-4A59-8F01-D7E6AD47D25F</value>
              <operator>equals</operator>
            </criteria-expression>
          </alert-search-criteria>
        </alert>
      </command-parameters>
    </command-request>
  </scom-request>
</request-data>

The following figure shows the adapter response.

Adapter response for the Find Alert History operation

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command> Import-Module OperationsManager; (Get-SCOMAlert -criteria {Id = '0B3AD3D6-7F2C-4A59-8F01-D7E6AD47D25F'}) | Get-SCOMAlertHistory | format-list</command>
        <execution-milliseconds>27347</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>1</count>
      </metadata>
      <output>
        <item>
          <MonitoringAlertId><![CDATA[0b3ad3d6-7f2c-4a59-8f01-d7e6ad47d25f]]></MonitoringAlertId>
          <ResolutionState>Closed</ResolutionState>
          <Owner></Owner>
          <CustomField1></CustomField1>
          <CustomField2></CustomField2>
          <CustomField3></CustomField3>
          <CustomField4></CustomField4>
          <CustomField5></CustomField5>
          <CustomField6></CustomField6>
          <CustomField7></CustomField7>
          <CustomField8></CustomField8>
          <CustomField9></CustomField9>
          <CustomField10></CustomField10>
          <Comments><![CDATA[Resolving Alert by Jyoti]]></Comments>
          <TimeModified>01/15/2017 10:23:21 PM</TimeModified>
          <TimeModifiedOffset><![CDATA[0]]></TimeModifiedOffset>
          <TimeResolutionStateLastModified>01/15/2017 10:23:21 PM</TimeResolutionStateLastModified>
          <TimeResolutionStateLastModifiedOffset><![CDATA[0]]></TimeResolutionStateLastModifiedOffset>
          <ModifiedBy><![CDATA[PUNBNADV21\SCOMADMIN]]></ModifiedBy>
          <TimeAdded>01/15/2017 10:23:43 PM</TimeAdded>
          <TicketId></TicketId>
          <Context></Context>
          <ConnectorId></ConnectorId>
          <TfsWorkItemId></TfsWorkItemId>
          <TfsWorkItemOwner></TfsWorkItemOwner>
          <Id><![CDATA[b102df8f-b67b-4b81-9865-4e1fb154c981]]></Id>
          <ManagementGroup><![CDATA[SCOM-GROUP]]></ManagementGroup>
          <ManagementGroupId><![CDATA[f0bfdf68-bb60-15e4-e21a-3678feeaa78e]]></ManagementGroupId>
        </item>
      </output>
    </command-output>
  </commands-output>
</scom-response>


Back to top
 

Find Alert by ID

The Find Alert by ID operation retrieves alerts that are identified by the specified globally unique identifier (GUID).

The following table describes the adapter request elements for the Find Alert by ID operation.

Adapter request elements for the Find Alert by ID operation

ElementDefinitionRequired

<operation-name>

Specifies the operation name: Get-SCOMAlert

Yes

<command-request>

Specifies the parent element for the command elements

Yes

<timeout-secs>

Specifies the duration after which the operation times out 

Default value: 60 seconds

No

<command-parameters>

Specifies the parent element for the command parameters

Yes

<alert-search-criteria>

Specifies the parent element for defining the search criterion

Yes

<criteria-expression>

Specifies the parent element for a single search criterion 

You can specify more than one filter criterion by using multiple <criteria-expression> elements.

Yes

<key>

Specifies the alert attribute used in the search 

Valid value: ID

Yes

<value>

Specifies the GUID that identifies the alert

Yes

<operator>

Specifies an operator

  • If you specify this element under the <alert-search-criteria> element, it specifies the operator between multiple <criteria-expression> elements. 

    Valid values: and, or
  • If you specify this element under the <criteria-expression> element, it specifies the operator for the <key> and <value> elements. 

    Valid values: equals, not equals, like, greater than, less than, in (to be used when the ID is used as a key)

Yes

For more information about writing regular expressions, see Regular Expressions in Microsoft System Center Operations Manager documentation .

The following figure shows the <items> XML for the Find Alert by ID operation.

<items> XML for the Find Alert by ID operation 

<items>
   <item>
      <timeout-secs>120</timeout-secs>
	 <command-parameters>
	      <alert-search-criteria>
	         <criteria-expression>
		       <key>Id</key> 
			  <value>9ea3e9ec-cdac-4b26-af49-25e28384ab26</value> 
			  <operator>equals</operator> 
	        </criteria-expression>
           </alert-search-criteria>
      </command-parameters>
   </item>
</items>

The following figure shows the sample adapter request.

Sample adapter request for the Find Alert by ID operation

<request-data>
  <scom-request>
    <operation-name>Get-Alert-By-Id</operation-name>
    <command-request>
      <timeout-secs>120</timeout-secs>
      <command-parameters>
        <alert-search-criteria>
          <operator>and</operator>
          <criteria-expression>
            <key>ID</key>
            <value>211E4501-749F-4D11-AFA0-EFBA1A89C56C</value>
            <operator>equals</operator>
          </criteria-expression>
        </alert-search-criteria>
      </command-parameters>
    </command-request>
  </scom-request>
</request-data>

The following figure shows the adapter response.

Adapter response for the Find Alert by ID operation

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command> Import-Module OperationsManager; Get-SCOMAlert -id 211E4501-749F-4D11-AFA0-EFBA1A89C56C | format-list</command>
        <execution-milliseconds>27159</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>1</count>
      </metadata>
      <output>
        <item>
          <Id><![CDATA[211e4501-749f-4d11-afa0-efba1a89c56c]]></Id>
          <Name><![CDATA[Power Shell Script failed to run]]></Name>
          <Description>The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</Description>
          <UnformattedDescription>The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</UnformattedDescription>
          <MonitoringObjectId><![CDATA[a0d974ba-e24b-10b1-b6ab-a05af10234d3]]></MonitoringObjectId>
          <MonitoringClassId><![CDATA[ab4c891f-3359-3fb6-0704-075fbfe36710]]></MonitoringClassId>
          <ClassId><![CDATA[ab4c891f-3359-3fb6-0704-075fbfe36710]]></ClassId>
          <MonitoringObjectDisplayName><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></MonitoringObjectDisplayName>
          <MonitoringObjectName></MonitoringObjectName>
          <MonitoringObjectPath><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></MonitoringObjectPath>
          <MonitoringObjectFullName>Microsoft.SystemCenter.HealthService:VW-PUN-BNA-DV22.punbnadv21.local</MonitoringObjectFullName>
          <IsMonitorAlert><![CDATA[False]]></IsMonitorAlert>
          <ProblemId><![CDATA[09deffed-41eb-a1ef-376a-b94c0ea1c4b4]]></ProblemId>
          <MonitoringRuleId><![CDATA[c4108e23-e5b9-b0cd-9b75-be85d2039035]]></MonitoringRuleId>
          <RuleId><![CDATA[c4108e23-e5b9-b0cd-9b75-be85d2039035]]></RuleId>
          <ResolutionState>New</ResolutionState>
          <Priority>Medium</Priority>
          <Severity><![CDATA[Warning]]></Severity>
          <Category><![CDATA[Alert]]></Category>
          <Owner></Owner>
          <ResolvedBy></ResolvedBy>
          <TimeRaised>12/14/2016 12:14:39 PM</TimeRaised>
          <TimeAdded>12/14/2016 12:14:39 PM</TimeAdded>
          <LastModified>01/05/2017 08:40:32 PM</LastModified>
          <LastModifiedBy><![CDATA[System]]></LastModifiedBy>
          <TimeResolved></TimeResolved>
          <TimeResolutionStateLastModified>12/14/2016 12:14:39 PM</TimeResolutionStateLastModified>
          <CustomField1></CustomField1>
          <CustomField2></CustomField2>
          <CustomField3></CustomField3>
          <CustomField4></CustomField4>
          <CustomField5></CustomField5>
          <CustomField6></CustomField6>
          <CustomField7></CustomField7>
          <CustomField8></CustomField8>
          <CustomField9></CustomField9>
          <CustomField10></CustomField10>
          <TicketId><![CDATA[111]]></TicketId>
          <Context><DataItem type="Microsoft.Windows.EventData" time="2017-01-06T14:10:32.0000000+05:30" sourceHealthServiceId="A0D974BA-E24B-10B1-B6AB-A05AF10234D3"><EventOriginId>{CD9D67C1-17F5-4422-B0E3-6186F5CEFEBC}</EventOriginId><PublisherId>{2DFE7810-DE9F-785F-CD11-80E1C9EE8A67}</PublisherId><PublisherName>Health Service Modules</PublisherName><EventSourceName>Health Service Modules</EventSourceName><Channel>Operations Manager</Channel><LoggingComputer>VW-PUN-BNA-DV22.punbnadv21.local</LoggingComputer><EventNumber>3221247878</EventNumber><EventCategory>0</EventCategory><EventLevel>1</EventLevel><UserName>N/A</UserName><RawDescription><![CDATA[The PowerShell script failed with below exception%n%n%7%n%n%nScript Name:%t%5%n%nOne or more workflows were affected by this. %n%nWorkflow name: %2%nInstance name: %3%nInstance ID: %4%nManagement group: %1]]></RawDescription><LCID>1033</LCID><Params><Param>SCOM-GROUP</Param><Param>ManagementGroupCollectionAlertsCountRule</Param><Param>All Management Servers Resource Pool</Param><Param>{4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}</Param><Param>GetMGAlertsCount.ps1</Param><Param>300</Param><Param><![CDATA[System.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)]]></Param><Param>System.Management.Automation.CmdletInvocationException</Param></Params><EventData><DataItem type="System.XmlData" time="2017-01-06T14:10:32.0000000+05:30" sourceHealthServiceId="A0D974BA-E24B-10B1-B6AB-A05AF10234D3"><EventData xmlns="http://schemas.microsoft.com/win/2004/08/events/event"><Data>SCOM-GROUP</Data><Data>ManagementGroupCollectionAlertsCountRule</Data><Data>All Management Servers Resource Pool</Data><Data>{4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}</Data><Data>GetMGAlertsCount.ps1</Data><Data>300</Data><Data>System.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)</Data><Data>System.Management.Automation.CmdletInvocationException</Data></EventData></DataItem></EventData><EventDisplayNumber>22406</EventDisplayNumber><EventDescription><![CDATA[The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP]]></EventDescription><Keywords>36028797018963968</Keywords></DataItem></Context>
          <ConnectorId></ConnectorId>
          <LastModifiedByNonConnector>01/05/2017 08:40:32 PM</LastModifiedByNonConnector>
          <MonitoringObjectInMaintenanceMode><![CDATA[False]]></MonitoringObjectInMaintenanceMode>
          <MonitoringObjectHealthState><![CDATA[Success]]></MonitoringObjectHealthState>
          <ConnectorStatus><![CDATA[NotMarkedForForwarding]]></ConnectorStatus>
          <RepeatCount><![CDATA[12]]></RepeatCount>
          <NetbiosComputerName><![CDATA[VW-PUN-BNA-DV22]]></NetbiosComputerName>
          <NetbiosDomainName><![CDATA[punbnadv21.local]]></NetbiosDomainName>
          <PrincipalName><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></PrincipalName>
          <SiteName></SiteName>
          <MaintenanceModeLastModified>12/31/1899 12:00:00 PM</MaintenanceModeLastModified>
          <StateLastModified>01/05/2017 04:52:13 PM</StateLastModified>
          <Parameters>{The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP}</Parameters>
          <TfsWorkItemId></TfsWorkItemId>
          <TfsWorkItemOwner></TfsWorkItemOwner>
          <ManagementGroup><![CDATA[SCOM-GROUP]]></ManagementGroup>
          <ManagementGroupId><![CDATA[f0bfdf68-bb60-15e4-e21a-3678feeaa78e]]></ManagementGroupId>
        </item>
      </output>
    </command-output>
  </commands-output>
</scom-response>

Back to top

Find Alerts By Computer Name 

The Find Alerts By Computer Name operation retrieves alerts that originated from the specified computer name. 

The following table describes the adapter request elements for the Find Alert by Computer Name operation.

Adapter request elements for the Find Alert by Computer Name operation

ElementDefinitionRequired

<operation-name>

Specifies the operation name: Get-SCOMAlert

Yes

<command-request>

Specifies the parent element for the command elements

Yes

<timeout-secs>

Specifies the duration after which the operation times out 

Default value: 60 seconds

No

<command-parameters>

Specifies the parent element for the command parameters

Yes

<alert-search-criteria>

Specifies the parent element for defining the search criterion

Yes

<criteria-expression>

Specifies the parent element for a single search criterion 

You can specify more than one filter criterion by using multiple <criteria-expression> elements.

Yes

<key>

Specifies the alert attribute used in the search 

Valid value: NetbiosComputerName

Yes

<value>

Specifies the computer name that is associated with the alert

Yes

<operator>

Specifies an operator

  • If you specify this element under the <alert-search-criteria> element, it specifies the operator between multiple <criteria-expression> elements. 

    Valid values: and, or
  • If you specify this element under the <criteria-expression> element, it specifies the operator for <key> and <value> elements. 

    Valid values: equals, not equals, like, greater than, less than, in (to be used when the ID is used as a key)
 

The following figure shows the <items> XML for the Find Alerts by Computer Name operation.

<items> XML for the Find Alerts By Computer Name operation

<items>
   <item>
      <timeout-secs>120</timeout-secs>  
      <command-parameters>
	    <computer-name>clm-pun-021145.vmw28rds1561dc.local</computer-name>
      </command-parameters>
   </item>
</items>

The following figure shows the sample adapter request XML for the Find Alerts by Computer Name operation.

Sample adapter request XML for the Find Alerts by Computer Name operation

<request-data>
  <scom-request>
    <operation-name>Get-Alert-By-ComputerName</operation-name>
    <command-request>
      <timeout-secs>120</timeout-secs>
      <command-parameters>
        <computer-name>VW-PUN-BNA-DV22.punbnadv21.local</computer-name>
      </command-parameters>
    </command-request>
  </scom-request>
</request-data>

The following figure shows the adapter response for the Find Alerts by Computer Name operation.

Adapter response for the Find Alerts by Computer Name operation

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command> Import-Module OperationsManager; Get-SCOMAlert -computername VW-PUN-BNA-DV22.punbnadv21.local | format-list</command>
        <execution-milliseconds>105535</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>302</count>
      </metadata>
      <output>
        <item>
          <Id><![CDATA[211e4501-749f-4d11-afa0-efba1a89c56c]]></Id>
          <Name><![CDATA[Power Shell Script failed to run]]></Name>
          <Description>The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</Description>
          <UnformattedDescription>The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</UnformattedDescription>
          <MonitoringObjectId><![CDATA[a0d974ba-e24b-10b1-b6ab-a05af10234d3]]></MonitoringObjectId>
          <MonitoringClassId><![CDATA[ab4c891f-3359-3fb6-0704-075fbfe36710]]></MonitoringClassId>
          <ClassId><![CDATA[ab4c891f-3359-3fb6-0704-075fbfe36710]]></ClassId>
          <MonitoringObjectDisplayName><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></MonitoringObjectDisplayName>
          <MonitoringObjectName></MonitoringObjectName>
          <MonitoringObjectPath><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></MonitoringObjectPath>
          <MonitoringObjectFullName>Microsoft.SystemCenter.HealthService:VW-PUN-BNA-DV22.punbnadv21.local</MonitoringObjectFullName>
          <IsMonitorAlert><![CDATA[False]]></IsMonitorAlert>
          <ProblemId><![CDATA[09deffed-41eb-a1ef-376a-b94c0ea1c4b4]]></ProblemId>
          <MonitoringRuleId><![CDATA[c4108e23-e5b9-b0cd-9b75-be85d2039035]]></MonitoringRuleId>
          <RuleId><![CDATA[c4108e23-e5b9-b0cd-9b75-be85d2039035]]></RuleId>
          <ResolutionState>New</ResolutionState>
          <Priority>Medium</Priority>
          <Severity><![CDATA[Warning]]></Severity>
          <Category><![CDATA[Alert]]></Category>
          <Owner></Owner>
          <ResolvedBy></ResolvedBy>
          <TimeRaised>12/14/2016 12:14:39 PM</TimeRaised>
          <TimeAdded>12/14/2016 12:14:39 PM</TimeAdded>
          <LastModified>01/05/2017 08:40:32 PM</LastModified>
          <LastModifiedBy><![CDATA[System]]></LastModifiedBy>
          <TimeResolved></TimeResolved>
          <TimeResolutionStateLastModified>12/14/2016 12:14:39 PM</TimeResolutionStateLastModified>
          <CustomField1></CustomField1>
          <CustomField2></CustomField2>
          <CustomField3></CustomField3>
          <CustomField4></CustomField4>
          <CustomField5></CustomField5>
          <CustomField6></CustomField6>
          <CustomField7></CustomField7>
          <CustomField8></CustomField8>
          <CustomField9></CustomField9>
          <CustomField10></CustomField10>
          <TicketId><![CDATA[111]]></TicketId>
          <Context><DataItem type="Microsoft.Windows.EventData" time="2017-01-06T14:10:32.0000000+05:30" sourceHealthServiceId="A0D974BA-E24B-10B1-B6AB-A05AF10234D3"><EventOriginId>{CD9D67C1-17F5-4422-B0E3-6186F5CEFEBC}</EventOriginId><PublisherId>{2DFE7810-DE9F-785F-CD11-80E1C9EE8A67}</PublisherId><PublisherName>Health Service Modules</PublisherName><EventSourceName>Health Service Modules</EventSourceName><Channel>Operations Manager</Channel><LoggingComputer>VW-PUN-BNA-DV22.punbnadv21.local</LoggingComputer><EventNumber>3221247878</EventNumber><EventCategory>0</EventCategory><EventLevel>1</EventLevel><UserName>N/A</UserName><RawDescription><![CDATA[The PowerShell script failed with below exception%n%n%7%n%n%nScript Name:%t%5%n%nOne or more workflows were affected by this. %n%nWorkflow name: %2%nInstance name: %3%nInstance ID: %4%nManagement group: %1]]></RawDescription><LCID>1033</LCID><Params><Param>SCOM-GROUP</Param><Param>ManagementGroupCollectionAlertsCountRule</Param><Param>All Management Servers Resource Pool</Param><Param>{4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}</Param><Param>GetMGAlertsCount.ps1</Param><Param>300</Param><Param><![CDATA[System.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)]]></Param><Param>System.Management.Automation.CmdletInvocationException</Param></Params><EventData><DataItem type="System.XmlData" time="2017-01-06T14:10:32.0000000+05:30" sourceHealthServiceId="A0D974BA-E24B-10B1-B6AB-A05AF10234D3"><EventData xmlns="http://schemas.microsoft.com/win/2004/08/events/event"><Data>SCOM-GROUP</Data><Data>ManagementGroupCollectionAlertsCountRule</Data><Data>All Management Servers Resource Pool</Data><Data>{4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}</Data><Data>GetMGAlertsCount.ps1</Data><Data>300</Data><Data>System.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)</Data><Data>System.Management.Automation.CmdletInvocationException</Data></EventData></DataItem></EventData><EventDisplayNumber>22406</EventDisplayNumber><EventDescription><![CDATA[The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP]]></EventDescription><Keywords>36028797018963968</Keywords></DataItem></Context>
          <ConnectorId></ConnectorId>
          <LastModifiedByNonConnector>01/05/2017 08:40:32 PM</LastModifiedByNonConnector>
          <MonitoringObjectInMaintenanceMode><![CDATA[False]]></MonitoringObjectInMaintenanceMode>
          <MonitoringObjectHealthState><![CDATA[Success]]></MonitoringObjectHealthState>
          <ConnectorStatus><![CDATA[NotMarkedForForwarding]]></ConnectorStatus>
          <RepeatCount><![CDATA[12]]></RepeatCount>
          <NetbiosComputerName><![CDATA[VW-PUN-BNA-DV22]]></NetbiosComputerName>
          <NetbiosDomainName><![CDATA[punbnadv21.local]]></NetbiosDomainName>
          <PrincipalName><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></PrincipalName>
          <SiteName></SiteName>
          <MaintenanceModeLastModified>12/31/1899 12:00:00 PM</MaintenanceModeLastModified>
          <StateLastModified>01/05/2017 04:52:13 PM</StateLastModified>
          <Parameters>{The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP}</Parameters>
          <TfsWorkItemId></TfsWorkItemId>
          <TfsWorkItemOwner></TfsWorkItemOwner>
          <ManagementGroup><![CDATA[SCOM-GROUP]]></ManagementGroup>
          <ManagementGroupId><![CDATA[f0bfdf68-bb60-15e4-e21a-3678feeaa78e]]></ManagementGroupId>
        </item>
        <item>
          <Id><![CDATA[b862c3e2-52ff-41eb-8134-f3b08ded77f8]]></Id>
          <Name><![CDATA[Power Shell Script failed to run]]></Name>
          <Description>The PowerShell script failed with below exceptionSystem.Management.Automation.MethodInvocationException: Exception calling "GetLocalizedDisplayString" with "1" argument(s): "You cannot call a method on a null-valued expression."At line:109 char:1+ AddPropertyBag $langClass.GetLocalizedDisplayString('HeathStateTotal') $totalAge ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.PSScriptMethod.InvokeScript(String methodName, ScriptBlock script, Object this, Object[] arguments)   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)   at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    AgentStateRollup.ps1One or 

Back to top

Find Alerts By Description

The Find Alerts by Description operation retrieves alerts that are identified by the specified description.

The following table describes the adapter request elements for the Find Alerts by Description operation.

Adapter request elements for the Find Alerts by Description operation 

Element

Definition

Required

<operation-name>

Specifies the operation name: Get-SCOMAlert

Yes

<command-request>

Specifies the parent element for the command elements

Yes

<timeout-secs>

Specifies the duration after which the operation times out 

Default value: 60 seconds

No

<command-parameters>

Specifies the parent element for the command parameters

Yes

<alert-search-criteria>

Specifies the parent element for defining the search criterion

Yes

<criteria-expression>

Specifies the parent element for a single search criterion 

You can specify more than one filter criterion by using multiple <criteria-expression> elements.

Yes

<key>

Specifies the alert attribute used in the search 

Valid value: Description

Yes

<value>

Specifies the description that is associated with the alert

Yes

<operator>

Specifies an operator

  • If you specify this element under the <alert-search-criteria> element, it specifies the operator between multiple <criteria-expression> elements. 

    Valid values: and, or
  • If you specify this element under the <criteria-expression> element, it specifies the operator for <key> and <value> elements. 

    Valid values: equals, not equals, like, greater than, less than, in (to be used when the ID is used as a key)

Yes

The following figure shows the <items> XML for the  Find Alerts by Description operation.

<items> XML for the Find Alerts by Description operation

<items>
   <item>
      <timeout-secs>120</timeout-secs>
      <command-parameters>
         <alert-search-criteria>
	       <criteria-expression>
		     <key>Description</key>
			<value>%The Health Service%</value>
			<operator>like</operator>
		  </criteria-expression>
         </alert-search-criteria>
      </command-parameters>
   </item>
</items>

The following figure shows the sample adapter request.

Sample adapter request for the Find Alerts by Description operation

<request-data>
  <scom-request>
    <operation-name>Get-Alert-By-Description</operation-name>
    <command-request>
      <timeout-secs>120</timeout-secs>
      <command-parameters>
        <alert-search-criteria>
          <criteria-expression>
            <key>Description</key>
            <value>%The%</value>
            <operator>like</operator>
          </criteria-expression>
        </alert-search-criteria>
      </command-parameters>
    </command-request>
  </scom-request>
</request-data>

The following figure shows the adapter response.

Adapter response for the Find Alerts by Description operation

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command> Import-Module OperationsManager; Get-SCOMAlert -criteria {Description LIKE '%The%'} | format-list</command>
        <execution-milliseconds>120024</execution-milliseconds>
        <exit-code>9999</exit-code>
        <status>success</status>
        <count>1</count>
      </metadata>
      <output>
        <item>
          <Id><![CDATA[281ee56e-ef2c-4165-8bc9-cdbc6f6c6e7a]]></Id>
          <Name>Data Warehouse monitor initial state data synchronization process failed to write state</Name>
          <Description>Data Warehouse monitor initial state data synchronization process failed to write state to the Data Warehouse database. Failed to store synchronization process state information in the Data Warehouse database. The operation will be retried.Exception 'SqlTimeoutException': Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.Timed out stored procedure: SynchronizationProcessStateSetOne or more workflows were affected by this. Workflow name: Microsoft.SystemCenter.DataWarehouse.Synchronization.MonitorInitialStateInstance name: Data Warehouse Synchronization ServiceInstance ID: {3889FBD2-704F-9335-B568-5654B54766FC}Management group: SCOM-GROUP</Description>
          <UnformattedDescription>Data Warehouse monitor initial state data synchronization process failed to write state to the Data Warehouse database. Failed to store synchronization process state information in the Data Warehouse database. The operation will be retried.Exception 'SqlTimeoutException': Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.Timed out stored procedure: SynchronizationProcessStateSetOne or more workflows were affected by this. Workflow name: Microsoft.SystemCenter.DataWarehouse.Synchronization.MonitorInitialStateInstance name: Data Warehouse Synchronization ServiceInstance ID: {3889FBD2-704F-9335-B568-5654B54766FC}Management group: SCOM-GROUP</UnformattedDescription>
          <MonitoringObjectId><![CDATA[3889fbd2-704f-9335-b568-5654b54766fc]]></MonitoringObjectId>
          <MonitoringClassId><![CDATA[8a5823d6-19a8-fc4a-2aac-52b3b09ba86b]]></MonitoringClassId>
          <ClassId><![CDATA[8a5823d6-19a8-fc4a-2aac-52b3b09ba86b]]></ClassId>
          <MonitoringObjectDisplayName><![CDATA[Data Warehouse Synchronization Service]]></MonitoringObjectDisplayName>
          <MonitoringObjectName><![CDATA[546871d3-2830-4220-910e-124e14df05c9]]></MonitoringObjectName>
          <MonitoringObjectPath></MonitoringObjectPath>
          <MonitoringObjectFullName>Microsoft.SystemCenter.DataWarehouseSynchronizationService:546871d3-2830-4220-910e-124e14df05c9</MonitoringObjectFullName>
          <IsMonitorAlert><![CDATA[True]]></IsMonitorAlert>
          <ProblemId><![CDATA[cdc1c6e4-7842-b976-868c-a821708fde95]]></ProblemId>
          <MonitoringRuleId><![CDATA[cdc1c6e4-7842-b976-868c-a821708fde95]]></MonitoringRuleId>
          <RuleId><![CDATA[cdc1c6e4-7842-b976-868c-a821708fde95]]></RuleId>
          <ResolutionState>Closed</ResolutionState>
          <Priority>Medium</Priority>
          <Severity>Critical</Severity>
          <Category><![CDATA[StateCollection]]></Category>
          <Owner></Owner>
          <ResolvedBy><![CDATA[PUNBNADV21\SCOMADMIN]]></ResolvedBy>
          <TimeRaised>01/01/2017 08:52:21 PM</TimeRaised>
          <TimeAdded>01/01/2017 08:52:22 PM</TimeAdded>
          <LastModified>01/09/2017 01:27:04 AM</LastModified>
          <LastModifiedBy><![CDATA[PUNBNADV21\SCOMADMIN]]></LastModifiedBy>
          <TimeResolved><![CDATA[1/9/2017 6:27:04 AM]]></TimeResolved>
          <TimeResolutionStateLastModified>01/09/2017 01:27:04 AM</TimeResolutionStateLastModified>
          <CustomField1></CustomField1>
          <CustomField2></CustomField2>
          <CustomField3></CustomField3>
          <CustomField4></CustomField4>
          <CustomField5></CustomField5>
          <CustomField6></CustomField6>
          <CustomField7></CustomField7>
          <CustomField8></CustomField8>
          <CustomField9></CustomField9>
          <CustomField10></CustomField10>
          <TicketId></TicketId>
          <Context><DataItem type="System.CorrelatorData" time="2017-01-02T07:16:21.0000013+05:30" sourceHealthServiceId="A0D974BA-E24B-10B1-B6AB-A05AF10234D3"><Item0Count>1</Item0Count><Item0Context><DataItem type="Microsoft.Windows.EventData" time="2017-01-02T07:16:21.0000013+05:30" sourceHealthServiceId="A0D974BA-E24B-10B1-B6AB-A05AF10234D3"><EventOriginId>{3F84E2A6-A9EB-4006-9991-BABEC3055D74}</EventOriginId><PublisherId>{2DFE7810-DE9F-785F-CD11-80E1C9EE8A67}</PublisherId><PublisherName>Health Service Modules</PublisherName><EventSourceName>Health Service Modules</EventSourceName><Channel>Operations Manager</Channel><LoggingComputer>VW-PUN-BNA-DV22.punbnadv21.local</LoggingComputer><EventNumber>3221257031</EventNumber><EventCategory>3</EventCategory><EventLevel>1</EventLevel><UserName>N/A</UserName><RawDescription><![CDATA[Failed to store synchronization process state information in the Data Warehouse database. The operation will be retried.%rException '%5': %6%n%nOne or more workflows were affected by this. </Context>
        </item>
      </output>
    </command-output>
  </commands-output>
</scom-response>

Back to top

Find Alerts By Name

The Find Alerts by Name operation retrieves alerts that are identified by the specified name.

The following table describes the adapter request elements for the Find Alerts by Name operation. 

Adapter request elements for the Find Alerts by Name operation

Element

Definition

Required

<operation-name>

Specifies the operation name: Get-SCOMAlert

Yes

<command-request>

Specifies the parent element for the command elements

Yes

<timeout-secs>

Specifies the duration after which the operation times out 

Default value: 60 seconds

No

<command-parameters>

Specifies the parent element for the command parameters

Yes

<alert-search-criteria>

Specifies the parent element for defining the search criterion

Yes

<criteria-expression>

Specifies the parent element for a single search criterion 

You can specify more than one filter criterion by using multiple <criteria-expression> elements.

Yes

<key>

Specifies the alert attribute used in the search 

Valid value: Name

Yes

<value>

Specifies the alert name that identifies the alert

Yes

<operator>

Specifies an operator

  • If you specify this element under the <alert-search-criteria> element, it specifies the operator between multiple <criteria-expression> elements. 

    Valid values: and, or
  • If you specify this element under the <criteria-expression> element, it specifies the operator for <key> and <value> elements. 

    Valid values: equals, not equals, like, greater than, less than, in (to be used when the ID is used as a key)

Yes

The following figure shows the <items> XML for the Find Alerts by Name operation.

<items> XML for the Find Alerts by Name operation

<items>
   <item>
      <timeout-secs>120</timeout-secs>
      <command-parameters>
         <alert-search-criteria>
	       <criteria-expression>
	          <key>Name</key>
                <value>Health Service Heartbeat Failure</value>
           	<operator>equals</operator>
           </criteria-expression>
         </alert-search-criteria>
      </command-parameters>
  </item>
</items>

The following figure shows the sample adapter request.

Sample adapter request for the Find Alerts by Name operation

<request-data>
  <scom-request>
    <operation-name>Get-Alert-By-Name</operation-name>
    <command-request>
      <timeout-secs>120</timeout-secs>
      <command-parameters>
        <alert-search-criteria>
          <criteria-expression>
            <key>Name</key>
            <value>Power Shell Script failed to run</value>
            <operator>equals</operator>
          </criteria-expression>
        </alert-search-criteria>
      </command-parameters>
    </command-request>
  </scom-request>
</request-data>

The following figure shows the adapter response.

Adapter response for the Find Alerts by Name operation

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command> Import-Module OperationsManager; Get-SCOMAlert -criteria {Name = 'Power Shell Script failed to run'} | format-list</command>
        <execution-milliseconds>29706</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>6</count>
      </metadata>
      <output>
        <item>
          <Id><![CDATA[211e4501-749f-4d11-afa0-efba1a89c56c]]></Id>
          <Name><![CDATA[Power Shell Script failed to run]]></Name>
          <Description>The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</Description>
          <UnformattedDescription>The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</UnformattedDescription>
          <MonitoringObjectId><![CDATA[a0d974ba-e24b-10b1-b6ab-a05af10234d3]]></MonitoringObjectId>
          <MonitoringClassId><![CDATA[ab4c891f-3359-3fb6-0704-075fbfe36710]]></MonitoringClassId>
          <ClassId><![CDATA[ab4c891f-3359-3fb6-0704-075fbfe36710]]></ClassId>
          <MonitoringObjectDisplayName><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></MonitoringObjectDisplayName>
          <MonitoringObjectName></MonitoringObjectName>
          <MonitoringObjectPath><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></MonitoringObjectPath>
          <MonitoringObjectFullName>Microsoft.SystemCenter.HealthService:VW-PUN-BNA-DV22.punbnadv21.local</MonitoringObjectFullName>
          <IsMonitorAlert><![CDATA[False]]></IsMonitorAlert>
          <ProblemId><![CDATA[09deffed-41eb-a1ef-376a-b94c0ea1c4b4]]></ProblemId>
          <MonitoringRuleId><![CDATA[c4108e23-e5b9-b0cd-9b75-be85d2039035]]></MonitoringRuleId>
          <RuleId><![CDATA[c4108e23-e5b9-b0cd-9b75-be85d2039035]]></RuleId>
          <ResolutionState>New</ResolutionState>
          <Priority>Medium</Priority>
          <Severity><![CDATA[Warning]]></Severity>
          <Category><![CDATA[Alert]]></Category>
          <Owner></Owner>
          <ResolvedBy></ResolvedBy>
          <TimeRaised>12/14/2016 12:14:39 PM</TimeRaised>
          <TimeAdded>12/14/2016 12:14:39 PM</TimeAdded>
          <LastModified>01/05/2017 08:40:32 PM</LastModified>
          <LastModifiedBy><![CDATA[System]]></LastModifiedBy>
          <TimeResolved></TimeResolved>
          <TimeResolutionStateLastModified>12/14/2016 12:14:39 PM</TimeResolutionStateLastModified>
          <CustomField1></CustomField1>
          <CustomField2></CustomField2>
          <CustomField3></CustomField3>
          <CustomField4></CustomField4>
          <CustomField5></CustomField5>
          <CustomField6></CustomField6>
          <CustomField7></CustomField7>
          <CustomField8></CustomField8>
          <CustomField9></CustomField9>
          <CustomField10></CustomField10>
          <TicketId><![CDATA[111]]></TicketId>
          <Context><DataItem type="Microsoft.Windows.EventData" time="2017-01-06T14:10:32.0000000+05:30" sourceHealthServiceId="A0D974BA-E24B-10B1-B6AB-A05AF10234D3"><EventOriginId>{CD9D67C1-17F5-4422-B0E3-6186F5CEFEBC}</EventOriginId><PublisherId>{2DFE7810-DE9F-785F-CD11-80E1C9EE8A67}</PublisherId><PublisherName>Health Service Modules</PublisherName><EventSourceName>Health Service Modules</EventSourceName><Channel>Operations Manager</Channel><LoggingComputer>VW-PUN-BNA-DV22.punbnadv21.local</LoggingComputer><EventNumber>3221247878</EventNumber><EventCategory>0</EventCategory><EventLevel>1</EventLevel><UserName>N/A</UserName><RawDescription><![CDATA[The PowerShell script failed with below exception%n%n%7%n%n%nScript Name:%t%5%n%nOne or more workflows were affected by this. %n%nWorkflow name: %2%nInstance name: %3%nInstance ID: %4%nManagement group: %1]]></RawDescription><LCID>1033</LCID><Params><Param>SCOM-GROUP</Param><Param>ManagementGroupCollectionAlertsCountRule</Param><Param>All Management Servers Resource Pool</Param><Param>{4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}</Param><Param>GetMGAlertsCount.ps1</Param><Param>300</Param><Param><![CDATA[System.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)]]></Param><Param>System.Management.Automation.CmdletInvocationException</Param></Params><EventData><DataItem type="System.XmlData" time="2017-01-06T14:10:32.0000000+05:30" sourceHealthServiceId="A0D974BA-E24B-10B1-B6AB-A05AF10234D3"><EventData xmlns="http://schemas.microsoft.com/win/2004/08/events/event"><Data>SCOM-GROUP</Data><Data>ManagementGroupCollectionAlertsCountRule</Data><Data>All Management Servers Resource Pool</Data><Data>{4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}</Data><Data>GetMGAlertsCount.ps1</Data><Data>300</Data><Data>System.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)</Data><Data>System.Management.Automation.CmdletInvocationException</Data></EventData></DataItem></EventData><EventDisplayNumber>22406</EventDisplayNumber><EventDescription><![CDATA[The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP]]></EventDescription><Keywords>36028797018963968</Keywords></DataItem></Context>
          <ConnectorId></ConnectorId>
          <LastModifiedByNonConnector>01/05/2017 08:40:32 PM</LastModifiedByNonConnector>
          <MonitoringObjectInMaintenanceMode><![CDATA[False]]></MonitoringObjectInMaintenanceMode>
          <MonitoringObjectHealthState><![CDATA[Success]]></MonitoringObjectHealthState>
          <ConnectorStatus><![CDATA[NotMarkedForForwarding]]></ConnectorStatus>
          <RepeatCount><![CDATA[12]]></RepeatCount>
          <NetbiosComputerName><![CDATA[VW-PUN-BNA-DV22]]></NetbiosComputerName>
          <NetbiosDomainName><![CDATA[punbnadv21.local]]></NetbiosDomainName>
          <PrincipalName><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></PrincipalName>
          <SiteName></SiteName>
          <MaintenanceModeLastModified>12/31/1899 12:00:00 PM</MaintenanceModeLastModified>
          <StateLastModified>01/05/2017 04:52:13 PM</StateLastModified>
          <Parameters>{The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP}</Parameters>
          <TfsWorkItemId></TfsWorkItemId>
          <TfsWorkItemOwner></TfsWorkItemOwner>
          <ManagementGroup><![CDATA[SCOM-GROUP]]></ManagementGroup>
          <ManagementGroupId><![CDATA[f0bfdf68-bb60-15e4-e21a-3678feeaa78e]]></ManagementGroupId>
        </item>
       
          <Id><![CDATA[0b3ad3d6-7f2c-4a59-8f01-d7e6ad47d25f]]></Id>
          <Name><![CDATA[Power Shell Script failed to run]]></Name>
          <Description>Forced to terminate the following PowerShell script because it ran past the configured timeout 300 seconds.Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</Description>
          <UnformattedDescription>Forced to terminate the following PowerShell script because it ran past the configured timeout 300 seconds.Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</UnformattedDescription>
          <MonitoringObjectId><![CDATA[a0d974ba-e24b-10b1-b6ab-a05af10234d3]]></MonitoringObjectId>
          <MonitoringClassId><![CDATA[ab4c891f-3359-3fb6-0704-075fbfe36710]]></MonitoringClassId>

Find Alerts By Ticket ID

The Find Alerts By Ticket ID operation retrieves the alert that is identified by the specified ticket ID. 

The following table describes the adapter request elements for the Find Alerts By Ticket ID operation. 

Adapter request elements for the Find Alerts By Ticket ID operation

Element

Definition

Required

<operation-name>

Specifies the operation name: get-alert-by-ticketid

Yes

<command-request>

Specifies the parent element for the command elements

Yes

<timeout-secs>

Specifies the duration after which the operation times out 

Default value: 60 seconds

No

<command-parameters>

Specifies the parent element for the command parameters

Yes

<alert-search-criteria>

Specifies the parent element for defining the search criterion

Yes

<criteria-expression>

Specifies the parent element for a single search criterion 

You can specify more than one filter criterion by using multiple <criteria-expression> elements.

Yes

<key>

Specifies the alert attribute used in the search 

Valid value: TicketId

Yes

<value>

Specifies the ticket ID that identifies the alert

Yes

<operator>

Specifies an operator

  • If you specify this element under the <alert-search-criteria> element, it specifies the operator between multiple <criteria-expression> elements. 

    Valid values: and, or
  • If you specify this element under the <criteria-expression> element, it specifies the operator for <key> and <value> elements. 

    Valid values: equals, not equals, like, greater than, less than, in (to be used when the ID is used as a key)

Yes

 

The following figure shows the <items> XML for the Find Alerts By Ticket ID operation. 

<items> XML for the Find Alerts By Ticket ID operation

<items>
    <item>
       <timeout-secs>120</timeout-secs>
       <command-parameters>
          <alert-search-criteria>
             <criteria-expression>
	           <key>TicketId</key>
           	<value>456378</value>
	           <operator>equals</operator>
	       </criteria-expression>
          </alert-search-criteria>
      </command-parameters>
   </item>
</items>

The following figure shows the sample adapter request.

Sample adapter request for the Find Alerts By Ticket ID operation

<request-data>
<scom-request>
<operation-name>Get-Alert-By-TicketId</operation-name>
<command-request>
<timeout-secs>120</timeout-secs>
<command-parameters>
<alert-search-criteria>
<criteria-expression>
<key>TicketId</key>
<value>1234</value>
<operator>equals</operator>
</criteria-expression>
</alert-search-criteria>
</command-parameters>
</command-request>
</scom-request>
</request-data>

The following figure shows the adapter response.

Adapter response for the Find Alerts By Ticket ID operation

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command> Import-Module OperationsManager; Get-SCOMAlert -computername VW-PUN-BNA-DV22.punbnadv21.local | format-list</command>
        <execution-milliseconds>105535</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>302</count>
      </metadata>
      <output>
        <item>
          <Id><![CDATA[211e4501-749f-4d11-afa0-efba1a89c56c]]></Id>
          <Name><![CDATA[Power Shell Script failed to run]]></Name>
          <Description>The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</Description>
          <UnformattedDescription>The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</UnformattedDescription>
          <MonitoringObjectId><![CDATA[a0d974ba-e24b-10b1-b6ab-a05af10234d3]]></MonitoringObjectId>
          <MonitoringClassId><![CDATA[ab4c891f-3359-3fb6-0704-075fbfe36710]]></MonitoringClassId>
          <ClassId><![CDATA[ab4c891f-3359-3fb6-0704-075fbfe36710]]></ClassId>
          <MonitoringObjectDisplayName><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></MonitoringObjectDisplayName>
          <MonitoringObjectName></MonitoringObjectName>
          <MonitoringObjectPath><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></MonitoringObjectPath>
          <MonitoringObjectFullName>Microsoft.SystemCenter.HealthService:VW-PUN-BNA-DV22.punbnadv21.local</MonitoringObjectFullName>
          <IsMonitorAlert><![CDATA[False]]></IsMonitorAlert>
          <ProblemId><![CDATA[09deffed-41eb-a1ef-376a-b94c0ea1c4b4]]></ProblemId>
          <MonitoringRuleId><![CDATA[c4108e23-e5b9-b0cd-9b75-be85d2039035]]></MonitoringRuleId>
          <RuleId><![CDATA[c4108e23-e5b9-b0cd-9b75-be85d2039035]]></RuleId>
          <ResolutionState>New</ResolutionState>
          <Priority>Medium</Priority>
          <Severity><![CDATA[Warning]]></Severity>
          <Category><![CDATA[Alert]]></Category>
          <Owner></Owner>
          <ResolvedBy></ResolvedBy>
          <TimeRaised>12/14/2016 12:14:39 PM</TimeRaised>
          <TimeAdded>12/14/2016 12:14:39 PM</TimeAdded>
          <LastModified>01/05/2017 08:40:32 PM</LastModified>
          <LastModifiedBy><![CDATA[System]]></LastModifiedBy>
          <TimeResolved></TimeResolved>
          <TimeResolutionStateLastModified>12/14/2016 12:14:39 PM</TimeResolutionStateLastModified>
          <CustomField1></CustomField1>
          <CustomField2></CustomField2>
          <CustomField3></CustomField3>
          <CustomField4></CustomField4>
          <CustomField5></CustomField5>
          <CustomField6></CustomField6>
          <CustomField7></CustomField7>
          <CustomField8></CustomField8>
          <CustomField9></CustomField9>
          <CustomField10></CustomField10>
          <TicketId><![CDATA[111]]></TicketId>
          <Context><DataItem type="Microsoft.Windows.EventData" time="2017-01-06T14:10:32.0000000+05:30" sourceHealthServiceId="A0D974BA-E24B-10B1-B6AB-A05AF10234D3"><EventOriginId>{CD9D67C1-17F5-4422-B0E3-6186F5CEFEBC}</EventOriginId><PublisherId>{2DFE7810-DE9F-785F-CD11-80E1C9EE8A67}</PublisherId><PublisherName>Health Service Modules</PublisherName><EventSourceName>Health Service Modules</EventSourceName><Channel>Operations Manager</Channel><LoggingComputer>VW-PUN-BNA-DV22.punbnadv21.local</LoggingComputer><EventNumber>3221247878</EventNumber><EventCategory>0</EventCategory><EventLevel>1</EventLevel><UserName>N/A</UserName><RawDescription><![CDATA[The PowerShell script failed with below exception%n%n%7%n%n%nScript Name:%t%5%n%nOne or more workflows were affected by this. %n%nWorkflow name: %2%nInstance name: %3%nInstance ID: %4%nManagement group: %1]]></RawDescription><LCID>1033</LCID><Params><Param>SCOM-GROUP</Param><Param>ManagementGroupCollectionAlertsCountRule</Param><Param>All Management Servers Resource Pool</Param><Param>{4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}</Param><Param>GetMGAlertsCount.ps1</Param><Param>300</Param><Param><![CDATA[System.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)]]></Param><Param>System.Management.Automation.CmdletInvocationException</Param></Params><EventData><DataItem type="System.XmlData" time="2017-01-06T14:10:32.0000000+05:30" sourceHealthServiceId="A0D974BA-E24B-10B1-B6AB-A05AF10234D3"><EventData xmlns="http://schemas.microsoft.com/win/2004/08/events/event"><Data>SCOM-GROUP</Data><Data>ManagementGroupCollectionAlertsCountRule</Data><Data>All Management Servers Resource Pool</Data><Data>{4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}</Data><Data>GetMGAlertsCount.ps1</Data><Data>300</Data><Data>System.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)</Data><Data>System.Management.Automation.CmdletInvocationException</Data></EventData></DataItem></EventData><EventDisplayNumber>22406</EventDisplayNumber><EventDescription><![CDATA[The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP]]></EventDescription><Keywords>36028797018963968</Keywords></DataItem></Context>
          <ConnectorId></ConnectorId>
          <LastModifiedByNonConnector>01/05/2017 08:40:32 PM</LastModifiedByNonConnector>
          <MonitoringObjectInMaintenanceMode><![CDATA[False]]></MonitoringObjectInMaintenanceMode>
          <MonitoringObjectHealthState><![CDATA[Success]]></MonitoringObjectHealthState>
          <ConnectorStatus><![CDATA[NotMarkedForForwarding]]></ConnectorStatus>
          <RepeatCount><![CDATA[12]]></RepeatCount>
          <NetbiosComputerName><![CDATA[VW-PUN-BNA-DV22]]></NetbiosComputerName>
          <NetbiosDomainName><![CDATA[punbnadv21.local]]></NetbiosDomainName>
          <PrincipalName><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></PrincipalName>
          <SiteName></SiteName>
          <MaintenanceModeLastModified>12/31/1899 12:00:00 PM</MaintenanceModeLastModified>
          <StateLastModified>01/05/2017 04:52:13 PM</StateLastModified>
          <Parameters>{The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP}</Parameters>
          <TfsWorkItemId></TfsWorkItemId>
          <TfsWorkItemOwner></TfsWorkItemOwner>
          <ManagementGroup><![CDATA[SCOM-GROUP]]></ManagementGroup>
          <ManagementGroupId><![CDATA[f0bfdf68-bb60-15e4-e21a-3678feeaa78e]]></ManagementGroupId>
        </item>
        <item>
          <Id><![CDATA[b862c3e2-52ff-41eb-8134-f3b08ded77f8]]></Id>
          <Name><![CDATA[Power Shell Script failed to run]]></Name>
          <Description>The PowerShell script failed with below exceptionSystem.Management.Automation.MethodInvocationException: Exception calling "GetLocalizedDisplayString" with "1" argument(s): "You cannot call a method on a null-valued expression."At line:109 char:1+ AddPropertyBag $langClass.GetLocalizedDisplayString('HeathStateTotal') $totalAge ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.PSScriptMethod.InvokeScript(String methodName, ScriptBlock script, Object this, Object[] arguments)   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)   at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    AgentStateRollup.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAgentHealthStatesRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</Description>
          <UnformattedDescription>The PowerShell script failed with below exceptionSystem.Management.Automation.MethodInvocationException: Exception calling "GetLocalizedDisplayString" with "1" argument(s): "You cannot call a method on a null-valued expression."At line:109 char:1+ AddPropertyBag $langClass.GetLocalizedDisplayString('HeathStateTotal') $totalAge ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.PSScriptMethod.InvokeScript(String methodName, ScriptBlock script, Object this, Object[] arguments)   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)   at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(Interpre

Back to top

Find Alerts

The Find Alerts operation retrieves alerts that are filtered by the specified search criterion. 

The following table describes the adapter request elements for the Find Alerts operation.

Adapter request elements for the Find Alerts operation

ElementDefinitionRequired

<operation-name>

Specifies the operation name: get-SCOMAlert

Yes

<command-request>

Specifies the parent element for the command elements

Yes

<timeout-secs>

Specifies the duration after which the operation times out 

Default value: 60 seconds

No

<command-parameters>

Specifies the parent element for the command parameters

No

<alert-search-criteria>

Specifies the parent element for defining the search criterion

No

<criteria-expression>

Specifies the parent element for a single search criterion 

You can specify more than one filter criterion by using multiple <criteria-expression> elements.

Conditional; required if the <alert-search-criteria>element is specified

<key>

Specifies the alert attribute used in the search 

Note

 

You can use the find-alert-by-id operation to retrieve all the available alert attributes.


Valid values:

  • ResolutionState
  • Priority
  • Severity
  • Category
  • ResolvedBy
  • Id
  • Name
  • ProblemId
  • Owner
  • LastModifiedBy
  • TicketId
  • ConnectorId
  • PrincipalName
  • SiteName

Conditional; required if the <alert-search-criteria>element is specified

<value>

Specifies the value of the attribute specified in the <key> element

Conditional; required if the <alert-search-criteria>element is specified

<operator>

Specifies an operator

  • If you specify this element under the <alert-search-criteria> element, it specifies the operator between multiple <criteria-expression> elements. 

    Valid values: and, or 
  • If you specify this element under the <criteria-expression> element, it specifies the operator for <key>and <value> elements. 

    Valid values: equals, not equals, like, greater than, less than, in (to be used when the ID is used as a key)

Conditional; required if the <alert-search-criteria>element is specified

The following figure shows the <items> XML for the Find Alerts operation.

<items> XML for the Find Alerts operation

<items>
  <item>
     <timeout-secs>120</timeout-secs>
     <command-parameters>
        <alert-search-criteria> 
           <operator>or</operator> 
           <criteria-expression> 
              <key>Id</key> 
              <value>19f7ab53-7760-4111-a4be-48e1d96ac487</value> 
              <operator>equals</operator> 
           </criteria-expression> 
           <criteria-expression> 
             <key>Id</key> 
             <value>4be8166b-2444-454e-9f81-534b7508f585</value> 
             <operator>equals</operator> 
           </criteria-expression> 
      </alert-search-criteria>
      </command-parameters>
   </item>
</items>

The following figure shows the sample adapter request for the Find Alerts operation.

Sample adapter request for the Find Alerts operation

<request-data>
  <scom-request>
    <operation-name>Get-SCOMAlert</operation-name>
    <command-request>
      <timeout-secs>120</timeout-secs>
      <command-parameters>
        <alert-search-criteria>
          <operator>and</operator>
          <criteria-expression>
            <key>ID</key>
            <value>211E4501-749F-4D11-AFA0-EFBA1A89C56C</value>
            <operator>equals</operator>
          </criteria-expression>
          <criteria-expression>
            <key>Priority</key>
            <value>Medium</value>
            <operator>like</operator>
          </criteria-expression>
        </alert-search-criteria>
      </command-parameters>
    </command-request>
  </scom-request>
</request-data>

The following figure shows the adapter response for the Find Alerts operation.

Adapter response for the Find Alerts operation

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command> Import-Module OperationsManager; Get-SCOMAlert -criteria {Id = '211E4501-749F-4D11-AFA0-EFBA1A89C56C' AND Priority LIKE 1} | format-list</command>
        <execution-milliseconds>28751</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>1</count>
      </metadata>
      <output>
        <item>
          <Id><![CDATA[211e4501-749f-4d11-afa0-efba1a89c56c]]></Id>
          <Name><![CDATA[Power Shell Script failed to run]]></Name>
          <Description>The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</Description>
          <UnformattedDescription>The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP</UnformattedDescription>
          <MonitoringObjectId><![CDATA[a0d974ba-e24b-10b1-b6ab-a05af10234d3]]></MonitoringObjectId>
          <MonitoringClassId><![CDATA[ab4c891f-3359-3fb6-0704-075fbfe36710]]></MonitoringClassId>
          <ClassId><![CDATA[ab4c891f-3359-3fb6-0704-075fbfe36710]]></ClassId>
          <MonitoringObjectDisplayName><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></MonitoringObjectDisplayName>
          <MonitoringObjectName></MonitoringObjectName>
          <MonitoringObjectPath><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></MonitoringObjectPath>
          <MonitoringObjectFullName>Microsoft.SystemCenter.HealthService:VW-PUN-BNA-DV22.punbnadv21.local</MonitoringObjectFullName>
          <IsMonitorAlert><![CDATA[False]]></IsMonitorAlert>
          <ProblemId><![CDATA[09deffed-41eb-a1ef-376a-b94c0ea1c4b4]]></ProblemId>
          <MonitoringRuleId><![CDATA[c4108e23-e5b9-b0cd-9b75-be85d2039035]]></MonitoringRuleId>
          <RuleId><![CDATA[c4108e23-e5b9-b0cd-9b75-be85d2039035]]></RuleId>
          <ResolutionState>New</ResolutionState>
          <Priority>Medium</Priority>
          <Severity><![CDATA[Warning]]></Severity>
          <Category><![CDATA[Alert]]></Category>
          <Owner></Owner>
          <ResolvedBy></ResolvedBy>
          <TimeRaised>12/14/2016 12:14:39 PM</TimeRaised>
          <TimeAdded>12/14/2016 12:14:39 PM</TimeAdded>
          <LastModified>01/05/2017 08:40:32 PM</LastModified>
          <LastModifiedBy><![CDATA[System]]></LastModifiedBy>
          <TimeResolved></TimeResolved>
          <TimeResolutionStateLastModified>12/14/2016 12:14:39 PM</TimeResolutionStateLastModified>
          <CustomField1></CustomField1>
          <CustomField2></CustomField2>
          <CustomField3></CustomField3>
          <CustomField4></CustomField4>
          <CustomField5></CustomField5>
          <CustomField6></CustomField6>
          <CustomField7></CustomField7>
          <CustomField8></CustomField8>
          <CustomField9></CustomField9>
          <CustomField10></CustomField10>
          <TicketId><![CDATA[111]]></TicketId>
          <Context><DataItem type="Microsoft.Windows.EventData" time="2017-01-06T14:10:32.0000000+05:30" sourceHealthServiceId="A0D974BA-E24B-10B1-B6AB-A05AF10234D3"><EventOriginId>{CD9D67C1-17F5-4422-B0E3-6186F5CEFEBC}</EventOriginId><PublisherId>{2DFE7810-DE9F-785F-CD11-80E1C9EE8A67}</PublisherId><PublisherName>Health Service Modules</PublisherName><EventSourceName>Health Service Modules</EventSourceName><Channel>Operations Manager</Channel><LoggingComputer>VW-PUN-BNA-DV22.punbnadv21.local</LoggingComputer><EventNumber>3221247878</EventNumber><EventCategory>0</EventCategory><EventLevel>1</EventLevel><UserName>N/A</UserName><RawDescription><![CDATA[The PowerShell script failed with below exception%n%n%7%n%n%nScript Name:%t%5%n%nOne or more workflows were affected by this. %n%nWorkflow name: %2%nInstance name: %3%nInstance ID: %4%nManagement group: %1]]></RawDescription><LCID>1033</LCID><Params><Param>SCOM-GROUP</Param><Param>ManagementGroupCollectionAlertsCountRule</Param><Param>All Management Servers Resource Pool</Param><Param>{4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}</Param><Param>GetMGAlertsCount.ps1</Param><Param>300</Param><Param><![CDATA[System.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)]]></Param><Param>System.Management.Automation.CmdletInvocationException</Param></Params><EventData><DataItem type="System.XmlData" time="2017-01-06T14:10:32.0000000+05:30" sourceHealthServiceId="A0D974BA-E24B-10B1-B6AB-A05AF10234D3"><EventData xmlns="http://schemas.microsoft.com/win/2004/08/events/event"><Data>SCOM-GROUP</Data><Data>ManagementGroupCollectionAlertsCountRule</Data><Data>All Management Servers Resource Pool</Data><Data>{4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}</Data><Data>GetMGAlertsCount.ps1</Data><Data>300</Data><Data>System.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)</Data><Data>System.Management.Automation.CmdletInvocationException</Data></EventData></DataItem></EventData><EventDisplayNumber>22406</EventDisplayNumber><EventDescription><![CDATA[The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP]]></EventDescription><Keywords>36028797018963968</Keywords></DataItem></Context>
          <ConnectorId></ConnectorId>
          <LastModifiedByNonConnector>01/05/2017 08:40:32 PM</LastModifiedByNonConnector>
          <MonitoringObjectInMaintenanceMode><![CDATA[False]]></MonitoringObjectInMaintenanceMode>
          <MonitoringObjectHealthState><![CDATA[Success]]></MonitoringObjectHealthState>
          <ConnectorStatus><![CDATA[NotMarkedForForwarding]]></ConnectorStatus>
          <RepeatCount><![CDATA[12]]></RepeatCount>
          <NetbiosComputerName><![CDATA[VW-PUN-BNA-DV22]]></NetbiosComputerName>
          <NetbiosDomainName><![CDATA[punbnadv21.local]]></NetbiosDomainName>
          <PrincipalName><![CDATA[VW-PUN-BNA-DV22.punbnadv21.local]]></PrincipalName>
          <SiteName></SiteName>
          <MaintenanceModeLastModified>12/31/1899 12:00:00 PM</MaintenanceModeLastModified>
          <StateLastModified>01/05/2017 04:52:13 PM</StateLastModified>
          <Parameters>{The PowerShell script failed with below exceptionSystem.Management.Automation.CmdletInvocationException: Collection was modified; enumeration operation may not execute.At line:24 char:32+             $relationships = @(Get-SCOMRelationship -Source $class) | Where {$_. ...+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)Script Name:    GetMGAlertsCount.ps1One or more workflows were affected by this. Workflow name: ManagementGroupCollectionAlertsCountRuleInstance name: All Management Servers Resource PoolInstance ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}Management group: SCOM-GROUP}</Parameters>
          <TfsWorkItemId></TfsWorkItemId>
          <TfsWorkItemOwner></TfsWorkItemOwner>
          <ManagementGroup><![CDATA[SCOM-GROUP]]></ManagementGroup>
          <ManagementGroupId><![CDATA[f0bfdf68-bb60-15e4-e21a-3678feeaa78e]]></ManagementGroupId>
        </item>
      </output>
    </command-output>
  </commands-output>
</scom-response>

Resolve Alerts

The Resolve Alerts operation resolves alerts that are filtered by the specified search criterion. 

The following table describes the adapter request elements for the Resolve Alerts operation.

Adapter request elements for the Resolve Alerts operation

ElementDefinitionRequired

<operation-name>

Specifies the operation name: Resolve-SCOMAlert

Yes

<command-request>

Specifies the parent element for the command elements

Yes

<timeout-secs>

Specifies the duration after which the operation times out 

Default value: 60 seconds

No

<command-parameters>

Specifies the parent element for the command parameters

Yes

<alert>

Specifies the search criterion to retrieve the alerts that you want to resolve

Yes

<alert-search-criteria>

Specifies the parent element for defining the search criterion

No

<criteria-expression>

Specifies the parent element for a single search criterion 

You can specify more than one filter criterion by using multiple <criteria-expression> elements.

Conditional; required if the <alert-search-criteria>element is specified

<key>

Specifies the alert attribute used in the search 

Valid values: Any valid alert attribute. For example, name, description, and ID. 

Note: You can use the find-alert-by-id operation to retrieve all the available alert attributes.

Conditional; required if the <alert-search-criteria>element is specified

<value>

Specifies the value of the attribute specified in the <key> element

Conditional; required if the <alert-search-criteria>element is specified

<operator>

Specifies an operator

  • If you specify this element under the <alert-search-criteria> element, it specifies the operator between multiple <criteria-expression> elements. 

    Valid values: and, or
  • If you specify this element under the <criteria-expression> element, it specifies the operator for <key>and <value> elements. 

    Valid values: equals, not equals, like, greater than, less than, in (to be used when the ID is used as a key)

Conditional; required if the <alert-search-criteria>element is specified

<resolve-alert-comment>

Specifies a comment to associate with the resolved alert

No

<preview>

Specifies whether you want to preview the results of the operation 

Valid values:

  • true: Indicates that you want to preview the results of the operation
  • false: Indicates that the operation is executed without displaying the results of the execution (default)

No

The following figure shows the <items> XML for the Resolve Alerts operation.

<items> XML for the Resolve Alerts operation

<items>
   <item>
      <timeout-secs>120</timeout-secs>
      <command-parameters>
         <alert>
            <alert-search-criteria>
	          <criteria-expression>
		        <key>Id</key>
		        <value>4be8166b-2444-454e-9f81-534b7508f585</value>
		        <operator>equals</operator>
	          </criteria-expression>
            </alert-search-criteria>
         </alert>
        <comment>
            <resolve-alert-comment>Resolving the alerts.</resolve-alert-comment>		
        </comment>
        <preview>true</preview>
    </command-parameters>
  </item>
</items>

The following figure shows the sample adapter request.

Adapter request for the Resolve Alerts operation

<request-data>
  <scom-request>
    <operation-name>Resolve-SCOMAlert</operation-name>
    <command-request>
      <timeout-secs>120</timeout-secs>
      <command-parameters>
        <alert>
          <alert-search-criteria>
            <criteria-expression>
              <key>Id</key>
              <value>2CAD8098-B73F-408A-8703-65BC8230C5D8</value>
              <operator>equals</operator>
            </criteria-expression>
          </alert-search-criteria>
        </alert>
        <comment>
          <resolve-alert-comment>Resolving Alert by Jyoti</resolve-alert-comment>
        </comment>
      </command-parameters>
    </command-request>
  </scom-request>
</request-data>

The following figure shows the adapter response.

Adapter response for the Resolve Alerts operation

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command> Import-Module OperationsManager; (Get-SCOMAlert -criteria {Id = '2CAD8098-B73F-408A-8703-65BC8230C5D8'}) | Resolve-SCOMAlert -comment 'Resolving Alert by Jyoti' | format-list</command>
        <execution-milliseconds>36239</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>0</count>
      </metadata>
      <output />
    </command-output>
  </commands-output>
</scom-response>


Back to top

Was this page helpful? Yes No Submitting... Thank you

Comments