Add-SCOMNotificationChannel
Adds a notification channel in Operations Manager.
Syntax
Add-SCOMNotificationChannel
[-Name] <String>
[-Port <UInt32>]
[-DisplayName <String>]
[-Description <String>]
-Server <String>
[-From] <String>
[-ReplyTo <String>]
[-Header <Hashtable>]
[-Anonymous]
[-ExternalEmail]
[-ExternalEmailRunasProfile <String>]
[-BackupSmtpServer <String[]>]
[-MaxPrimaryRecipientsPerMail <Int32>]
[-PrimaryRetryInterval <TimeSpan>]
[-Subject <String>]
-Body <String>
[-BodyAsHtml]
[-Encoding <String>]
[-NoSubjectEncoding]
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Add-SCOMNotificationChannel
[-Name] <String>
[-Port <UInt32>]
[-DisplayName <String>]
[-Description <String>]
[-UserName] <Uri>
[-ContentType <String>]
-Server <String>
[-SipProtocol <SipTransportProtocol>]
[-SipAuthentication <SipNotificationAuthenticationProtocols>]
[-PreferredUserName <String>]
-Body <String>
[-Encoding <String>]
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Add-SCOMNotificationChannel
[-Name] <String>
[-DisplayName <String>]
[-Description <String>]
[-ApplicationPath] <String>
[[-Argument] <String>]
[-WorkingDirectory <String>]
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Add-SCOMNotificationChannel
[-Name] <String>
[-DisplayName <String>]
[-Description <String>]
[-PrimaryRetryInterval <TimeSpan>]
[-DeviceEnumerationInterval <TimeSpan>]
[-Sms]
[[-Device] <String>]
[[-BackupDevice] <String[]>]
-Body <String>
[-Encoding <String>]
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Add-SCOMNotificationChannel cmdlet adds a notification channel in System Center 2016 - 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.
Examples
Example 1: Add a notification 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
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.
Example 2: Add a notification channel for IM
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
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.
Example 3: Add a notification channel for SMS
PS C:\>$Body = "SCOM alert `$Data[Default='Not Present']/Context/DataItem/AlertName`$"
PS C:\> Add-SCOMNotificationChannel -Sms -Name "Contoso.SMS" -Body $Body -Encoding "Unicode"
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.
Example 4: 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
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.
Parameters
-Anonymous
Indicates that an anonymous Simple Mail Transfer Protocol (SMTP) server sends email notifications.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ApplicationPath
Specifies the application path of a command channel.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Argument
Specifies an argument list to a command channel.
Type: | String |
Position: | 2 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-BackupDevice
Specifies an array of secondary SMS devices.
Type: | String[] |
Position: | 3 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-BackupSmtpServer
Specifies an array of backup SMTP servers. Backup servers use the same configuration as the primary SMTP server.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Body
Specifies the body of a notification message.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-BodyAsHtml
Indicates that the service formats the body of the message as HTML.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ComputerName
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 (.).
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ContentType
Specifies the content type of an IM.
By default, the content type is text/plain
.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Credential
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.
Type: | PSCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
Specifies a description for a notification channel. If you do not set a value, the default is the value of the DisplayName parameter.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Device
Specifies a primary SMS device.
Type: | String |
Position: | 2 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DeviceEnumerationInterval
Specifies a time interval between SMS notifications. By default, the notification channel waits 10 seconds.
Type: | TimeSpan |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DisplayName
Specifies a display name for a notification channel. If you do not set a value, the default is the value of the Name parameter.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Encoding
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.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ExternalEmail
Specifies whether to use external email.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ExternalEmailRunasProfile
Specifies the Run as profile for external email.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-From
Specifies the From header in a notification e-mail message.
Type: | String |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Header
Specifies headers, as key-value pairs, in a notification email message.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-MaxPrimaryRecipientsPerMail
Specifies the maximum number of recipients for a notification email message.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies the name of a notification channel.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-NoSubjectEncoding
Indicates that the cmdlet does not encode the email subject line.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Port
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.
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PreferredUserName
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.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PrimaryRetryInterval
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.
Type: | TimeSpan |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ReplyTo
Specifies the Reply-to header in a notification email message.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SCSession
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.
Type: | Connection[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Server
Specifies a server that provides SMTP and IM channels for notifications.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SipAuthentication
Specifies a Session Initiation Protocol (SIP) authentication mechanism (NTLM or Kerberos) for IM channels. By default, SIP authentication uses NTLM authentication.
Type: | SipNotificationAuthenticationProtocols |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SipProtocol
Specifies a SIP transport protocol (TCP or TLS) for IM channels. By default, SIP uses TCP as a transport protocol.
Type: | SipTransportProtocol |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Sms
Indicates that the cmdlet sends notifications by using SMS.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Subject
Specifies a subject line for the notification email message.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-UserName
Specifies a return address for IM.
Type: | Uri |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WorkingDirectory
Specifies a working directory for a command channel. By default, a command channel uses the %systemdrive% as a working directory.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |