Partager via


New-SCSMAlertRule

Creates an alert rule to be used with an Operations Manager Alert connector in Service Manager.

Syntax

New-SCSMAlertRule
   -Class <String>
   -Operator <CompareOperator>
   [-Name] <String>
   [-Priority <Priority>]
   [-Severity <Severity>]
   -Template <ManagementPackObjectTemplate>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
New-SCSMAlertRule
   -Operator <CompareOperator>
   -ManagementPack <String>
   [-Name] <String>
   [-Priority <Priority>]
   [-Severity <Severity>]
   -Template <ManagementPackObjectTemplate>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
New-SCSMAlertRule
   [-CustomField1 <String>]
   [-CustomOperator1 <CompareOperator>]
   [-CustomField2 <String>]
   [-CustomOperator2 <CompareOperator>]
   [-CustomField3 <String>]
   [-CustomOperator3 <CompareOperator>]
   [-CustomField4 <String>]
   [-CustomOperator4 <CompareOperator>]
   [-CustomField5 <String>]
   [-CustomOperator5 <CompareOperator>]
   [-CustomField6 <String>]
   [-CustomOperator6 <CompareOperator>]
   [-CustomField7 <String>]
   [-CustomOperator7 <CompareOperator>]
   [-CustomField8 <String>]
   [-CustomOperator8 <CompareOperator>]
   [-CustomField9 <String>]
   [-CustomOperator9 <CompareOperator>]
   [-CustomField10 <String>]
   [-CustomOperator10 <CompareOperator>]
   [-Name] <String>
   [-Priority <Priority>]
   [-Severity <Severity>]
   -Template <ManagementPackObjectTemplate>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
New-SCSMAlertRule
   -Group <String>
   [-Name] <String>
   [-Priority <Priority>]
   [-Severity <Severity>]
   -Template <ManagementPackObjectTemplate>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
New-SCSMAlertRule
   [-NoCriteria]
   [-Name] <String>
   [-Priority <Priority>]
   [-Severity <Severity>]
   -Template <ManagementPackObjectTemplate>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]

Description

The New-SCSMAlertRule cmdlet creates an alert rule to use with an Operations Manager Alert connector in Service Manager.

Examples

Example 1: Create an alert rule for an Operations Manager Alert connector

PS C:\>$rule = new-SCSMAlertRule @{

    Name = "newRule" 

    Template = Get-SCSMObjectTemplate -name .*IncidentTemplate.* 

    ManagementPack = Get-SCManagementPack -Name System.Library

    }

This command creates a new alert rule for an Operations Manager Alert connector.

Parameters

-Class

Specifies an instance of the monitoring class for which the alert was raised.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ComputerName

Specifies the name of the computer on which the System Center Data Access service runs. The user account that is specified in the Credential parameter must have access rights to the specified computer.

Type:System.String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

Specifies the credentials that this cmdlet uses to connect to the server on which the System Center Data Access service runs. The specified user account must have access rights to that server.

Type:System.Management.Automation.PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomField1

Specifies the value for CustomField1. If you specify a value for this parameter, you must also specify a value for the CustomOperator1 parameter.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomField10

Specifies the value for CustomField10. If you specify a value for this parameter, you must also specify a value for the CustomOperator10 parameter.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomField2

Specifies the value for CustomField2. If you specify a value for this parameter, you must also specify a value for the CustomOperator2 parameter.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomField3

Specifies the value for CustomField3. If you specify a value for this parameter, you must also specify a value for the CustomOperator3 parameter.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomField4

Specifies the value for CustomField4. If you specify a value for this parameter, you must also specify a value for the CustomOperator4 parameter.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomField5

Specifies the value for CustomField5. If you specify a value for this parameter, you must also specify a value for the CustomOperator5 parameter.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomField6

Specifies the value for CustomField6. If you specify a value for this parameter, you must also specify a value for the CustomOperator6 parameter.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomField7

Specifies the value for CustomField7. If you specify a value for this parameter, you must also specify a value for the CustomOperator7 parameter.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomField8

Specifies the value for CustomField8. If you specify a value for this parameter, you must also specify a value for the CustomOperator8 parameter.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomField9

Specifies the value for CustomField9. If you specify a value for this parameter, you must also specify a value for the CustomOperator9 parameter.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomOperator1

Specifies the operator to apply to CustomField1. If you specify this parameter, you must also specify a value in the CustomField1 parameter. Valid values are:

  • Equals
  • Contains
Type:System.Nullable`1[Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.CompareOperator]
Accepted values:Equals, Contains
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomOperator10

Specifies the operator to apply to CustomField10. If you specify this parameter, you must also specify a value in the CustomField10 parameter. Valid values are:

  • Equals
  • Contains
Type:System.Nullable`1[Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.CompareOperator]
Accepted values:Equals, Contains
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomOperator2

Specifies the operator to apply to CustomField2. If you specify this parameter, you must also specify the CustomField2 parameter. Valid values are:

  • Equals
  • Contains
Type:System.Nullable`1[Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.CompareOperator]
Accepted values:Equals, Contains
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomOperator3

Specifies the operator to apply to CustomField3. If you specify this parameter, you must also specify the CustomField3 parameter. Valid values are:

  • Equals
  • Contains
Type:System.Nullable`1[Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.CompareOperator]
Accepted values:Equals, Contains
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomOperator4

Specifies the operator to apply to CustomField4. If you specify this parameter, you must also specify the CustomField4 parameter. Valid values are:

  • Equals
  • Contains
Type:System.Nullable`1[Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.CompareOperator]
Accepted values:Equals, Contains
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomOperator5

Specifies the operator to apply to CustomField5. If you specify this parameter, you must also specify the CustomField5 parameter. Valid values are:

  • Equals
  • Contains
Type:System.Nullable`1[Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.CompareOperator]
Accepted values:Equals, Contains
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomOperator6

Specifies the operator to apply to CustomField6. If you specify this parameter, you must also specify the CustomField6 parameter. Valid values are:

  • Equals
  • Contains
Type:System.Nullable`1[Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.CompareOperator]
Accepted values:Equals, Contains
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomOperator7

Specifies the operator to apply to CustomField7. If you specify this parameter, you must also specify the CustomField7 parameter. Valid values are:

  • Equals
  • Contains
Type:System.Nullable`1[Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.CompareOperator]
Accepted values:Equals, Contains
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomOperator8

Specifies the operator to apply to CustomField8. If you specify this parameter, you must also specify the CustomField8 parameter. Valid values are:

  • Equals
  • Contains
Type:System.Nullable`1[Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.CompareOperator]
Accepted values:Equals, Contains
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomOperator9

Specifies the operator to apply to CustomField9. If you specify this parameter, you must also specify the CustomField9 parameter. Valid values are:

  • Equals
  • Contains
Type:System.Nullable`1[Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.CompareOperator]
Accepted values:Equals, Contains
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Group

Specifies the name of the group that contains the computers to be associated with the alert rule.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ManagementPack

Specifies the list of management packs.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the alert rule.

Type:System.String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NoCriteria

Indicates that this cmdlet configures the alert rule to have no criteria.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Operator

Specifies the comparison operator to use in the alert rule. Valid values are:

  • Equals
  • Contains
Type:Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.CompareOperator
Accepted values:Equals, Contains
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Priority

Specifies the priority of the alert rule. Valid values are:

  • Low
  • Medium
  • High
Type:Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.Priority
Accepted values:Unspecified, Low, Medium, High
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SCSession

Specifies an object that represents the session to a Service Manager management server.

Type:Microsoft.SystemCenter.Core.Connection.Connection[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Severity

Specifies the severity of the alert rule. Valid values are:

  • Low
  • Medium
  • High
Type:Microsoft.EnterpriseManagement.ServiceManager.Connectors.OpsMgr.Severity
Accepted values:Unspecified, Information, Warning, Error
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Template

Specifies the template to apply to the rule.

Type:Microsoft.EnterpriseManagement.Configuration.ManagementPackObjectTemplate
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None.

You cannot pipe input to this cmdlet.

Outputs

None.

Notes

  • This cmdlet does not generate any output.