Add-SCOMNotificationChannel

Add-SCOMNotificationChannel

Adds a notification channel in Operations Manager.

Syntax

Parameter Set: UsingSMTP
Add-SCOMNotificationChannel [-Name] <String> [-From] <String> -Body <String> -Server <String> [-Anonymous] [-BackupSmtpServer <String[]> ] [-BodyAsHtml] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-Description <String> ] [-DisplayName <String> ] [-Encoding <String> ] [-Header <Hashtable> ] [-MaxPrimaryRecipientsPerMail <Int32> ] [-NoSubjectEncoding] [-Port <UInt32> ] [-PrimaryRetryInterval <TimeSpan> ] [-ReplyTo <String> ] [-SCSession <Connection[]> ] [-Subject <String> ] [ <CommonParameters>]

Parameter Set: CommandAction
Add-SCOMNotificationChannel [-ApplicationPath] <String> [-Name] <String> [[-Argument] <String> ] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-Description <String> ] [-DisplayName <String> ] [-SCSession <Connection[]> ] [-WorkingDirectory <String> ] [ <CommonParameters>]

Parameter Set: UsingSIP
Add-SCOMNotificationChannel [-Name] <String> [-UserName] <Uri> -Body <String> -Server <String> [-ComputerName <String[]> ] [-ContentType <String> ] [-Credential <PSCredential> ] [-Description <String> ] [-DisplayName <String> ] [-Encoding <String> ] [-Port <UInt32> ] [-PreferredUserName <String> ] [-SCSession <Connection[]> ] [-SipAuthentication <SipNotificationAuthenticationProtocols> ] [-SipProtocol <SipTransportProtocol> ] [ <CommonParameters>]

Parameter Set: UsingSMS
Add-SCOMNotificationChannel [-Name] <String> [[-Device] <String> ] [[-BackupDevice] <String[]> ] -Body <String> -Sms [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-Description <String> ] [-DeviceEnumerationInterval <TimeSpan> ] [-DisplayName <String> ] [-Encoding <String> ] [-PrimaryRetryInterval <TimeSpan> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Detailed Description

The Add-SCOMNotificationChannel cmdlet adds a notification channel in System Center 2012 – Operations Manager. Notification channels inform administrators of an alert, or they run automation in response to an alert. A notification channel uses a delivery mechanism in Operations Manager, such as email, instant messaging (IM), Short Message Service (SMS), or command, to deliver notifications.

Parameters

-Anonymous

Indicates that an anonymous Simple Mail Transfer Protocol (SMTP) server sends email notifications.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-ApplicationPath<String>

Specifies the application path of a command channel.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Argument<String>

Specifies an argument list to a command channel.

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-BackupDevice<String[]>

Specifies an array of secondary SMS devices.

Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-BackupSmtpServer<String[]>

Specifies an array of backup SMTP servers. Backup servers use the same configuration as the primary SMTP server.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Body<String>

Specifies the body of a notification message.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-BodyAsHtml

Indicates that the service formats the body of the message as HTML.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-ComputerName<String[]>

Specifies an array of names of computers. The cmdlet establishes temporary connections with management groups for these computers. You can use NetBIOS names, IP addresses, or fully qualified domain names (FQDNs). To specify the local computer, type the computer name, localhost, or a dot (.).

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-ContentType<String>

Specifies the content type of an IM. By default, the content type is text/plain.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Credential<PSCredential>

Specifies a PSCredential object for the management group connection. To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type "Get-Help Get-Credential".

If you specify a computer in the ComputerName parameter, use an account that has access to that computer. The default is the current user.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Description<String>

Specifies a description for a notification channel. If you do not set a value, the default is the value of the DisplayName parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Device<String>

Specifies a primary SMS device.

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-DeviceEnumerationInterval<TimeSpan>

Specifies a time interval between SMS notifications. By default, the notification channel waits 10 seconds.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-DisplayName<String>

Specifies a display name for a notification channel. If you do not set a value, the default is the value of the Name parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Encoding<String>

Specifies the encoding format for a notification message. An SMTP channel uses UTF-8 encoding by default. An IM channel also uses UTF-8 encoding by default. An SMS channel uses Default encoding by default but can alternately use Unicode encoding.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-From<String>

Specifies the From header in a notification e-mail message.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Header<Hashtable>

Specifies headers, as key-value pairs, in a notification email message.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-MaxPrimaryRecipientsPerMail<Int32>

Specifies the maximum number of recipients for a notification email message.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of a notification channel.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-NoSubjectEncoding

Indicates that the cmdlet does not encode the email subject line.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Port<UInt32>

Specifies the port number for a channel.

An SMTP channel uses port 25 by default. An IM channel that uses TCP uses port 5060 by default, and an IM channel that uses Transport Layer Security (TLS) uses port 5061 by default.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-PreferredUserName<String>

Specifies the preferred user name of an IM channel. If you do not set a value, the default is the value of the Username parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-PrimaryRetryInterval<TimeSpan>

Specifies a retry interval. The service attempts to switch back to the primary SMTP server or SMS device. By default, the interval is five minutes.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-ReplyTo<String>

Specifies the Reply-to header in a notification email message.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-SCSession<Connection[]>

Specifies an array of Connection objects. To obtain a Connection object, use the Get-SCManagementGroupConnection cmdlet.

Enter a connection object for a management group, such as one that the Get-SCManagementGroupConnection cmdlet returns.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Server<String>

Specifies a server that provides SMTP and IM channels for notifications.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-SipAuthentication<SipNotificationAuthenticationProtocols>

Specifies a Session Initiation Protocol (SIP) authentication mechanism (NTLM or Kerberos) for IM channels. By default, SIP authentication uses NTLM authentication.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-SipProtocol<SipTransportProtocol>

Specifies a SIP transport protocol (TCP or TLS) for IM channels. By default, SIP uses TCP as a transport protocol.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Sms

Indicates that the cmdlet sends notifications by using SMS.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Subject<String>

Specifies a subject line for the notification email message.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-UserName<Uri>

Specifies a return address for IM.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-WorkingDirectory<String>

Specifies a working directory for a command channel. By default, a command channel uses the %systemdrive% as a working directory.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Add a notification channel

This example adds a standard SMTP email channel.

The first command stores the subject line in the variable named $Subject.

The second command stores the message body in the variable named $Body.

The third command uses the Add-SCOMNotificationChannel cmdlet to add an SMTP email channel.

PS C:\> $Subject = "SCOM alert `$Data[Default='Not Present']/Context/DataItem/AlertName`$"
PS C:\> $Body = "Owner is `$Data[Default='Not Present']/Context/DataItem/AlertOwner`$"
PS C:\> Add-SCOMNotificationChannel -Name "Contoso.Email" -Server "mail.contoso.com" -From "scom@contoso.net" -Subject $Subject -Body $Body

Example 2: Add a notification channel for IM

This example adds an IM channel that has a return address of scomadmin.

The first command stores the message body in the variable named $Body.

The second command uses the Add-SCOMNotificationChannel cmdlet to add an IM channel.

PS C:\> $Body = "SCOM alert `$Data[Default='Not Present']/Context/DataItem/AlertName`$"
PS C:\> Add-SCOMNotificationChannel -Name "Contoso.IM" -Server "sipserver.contoso.com" -UserName 'sip:scomadmin' -Body $Body

Example 3: Add a notification channel for SMS

This example adds an SMS channel that has Unicode encoding.

The first command stores the message body in the variable named $Body.

The second command uses the Add-SCOMNotificationChannel cmdlet to add an SMS channel.

PS C:\> $Body = "SCOM alert `$Data[Default='Not Present']/Context/DataItem/AlertName`$"
PS C:\> Add-SCOMNotificationChannel -Sms -Name "Contoso.SMS" -Body $Body -Encoding "Unicode"

Example 4: Add a command notification channel

This example adds a command notification channel that runs the OnNotify.exe program.

The first command stores the path to the executable file in the variable named $Path.

The second command stores the arguments in the variable named $Arg.

The third command stores the working directory in the variable named $WorkingDir.

The fourth command uses the Add-SCOMNotificationChannel cmdlet to add a command notification channel.

PS C:\> $Path = "C:\OnNotify.exe"
PS C:\> $Arg = "/notify /owner `"`$Data[Default='Not Present']/Context/DataItem/AlertOwner`$`""
PS C:\> $WorkingDir = "C:\"
PS C:\> Add-SCOMNotificationChannel -Name "Contoso.Command" -ApplicationPath $Path -Argument $Arg -WorkingDirectory $WorkingDir

Get-SCOMNotificationChannel

Remove-SCOMNotificationChannel