Add-SCOMNotificationSubscriber

在 Operations Manager 中添加通知订阅服务器。

语法

Add-SCOMNotificationSubscriber
   [-Name] <String>
   [-DeviceList] <String[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Add-SCOMNotificationSubscriber
   [-Name] <String>
   [-DeviceTable] <Hashtable>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

说明

Add-SCOMNotificationSubscriber cmdlet 在 System Center - Operations Manager 中添加通知订阅者。

通知订阅者接收来自 Operations Manager 的通知。

示例

示例 1:添加通知订户

PS C:\>Add-SCOMNotificationSubscriber -Name "Sarah Jones" -DeviceList "SarahJones@contoso.com", "sms:2065551212", "sip:SarahJ"

此命令添加包含电子邮件、短信和 IM 地址的新通知订阅者。

示例 2:使用命令通道添加通知订阅者

PS C:\>$CommandChannel = Get-SCOMNotificationChannel -DisplayName "OnNotify.exe"
PS C:\> Add-SCOMNotificationSubscriber -Name "Sarah Jones" -DeviceTable @{"Cell"= 'sms:206555213'; "Command" = $CommandChannel.Name }

此示例添加一个具有短信地址和命令地址的新通知订阅服务器。

第一个命令使用 Get-SCOMNotificationChannel cmdlet 获取显示名称 OnNotify.exe 的通知通道,并将结果存储在 $CommandChannel 变量中。

第二个命令使用 Name 参数添加通知订阅服务器。

参数

-ComputerName

指定计算机的名称数组。 cmdlet 与这些计算机的管理组建立临时连接。 可以使用 NetBIOS 名称、IP 地址或完全限定的域名 (FQDN) 。 若要指定本地计算机,请键入该计算机名称、localhost 或句点 (.)。

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

-Confirm

提示你在运行 cmdlet 之前进行确认。

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

为管理组连接指定 PSCredential 对象。 若要获取 PSCredential 对象,请使用 Get-Credential cmdlet。 有关详细信息,请键入“Get-Help Get-Credential”。 如果在 ComputerName 参数中指定计算机,请使用有权访问该计算机的帐户。 默认为当前用户。

Type:PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DeviceList

指定通知地址的数组。 对电子邮件地址使用表单,对短信地址使用 username@domain.com SMS:<address> ,对 IM 地址使用 SIP:<address> 。 指定命令通道的通道名称。

Type:String[]
Aliases:Email, IM, SMS, MobileNumber, Number
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DeviceTable

指定命名地址的表。 对电子邮件地址使用表单,对短信地址使用 username@domain.com SMS:<address> ,对 IM 地址使用 SIP:<address> 。 指定命令通道的通道名称。

Type:Hashtable
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

指定通知订户的名称。

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SCSession

指定 Connection 对象的数组。 若要获取 Connection 对象,请使用 Get-SCManagementGroupConnection cmdlet。

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

-WhatIf

显示运行该 cmdlet 时会发生什么情况。 此 cmdlet 未运行。

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False