Set-MgmtSvcNotificationSubscriber
Adds or updates a notification subscriber.
Syntax
Set-MgmtSvcNotificationSubscriber
-Name <String>
[-Enabled <Boolean>]
[-SubscriberType <NotificationSubscriberType>]
-Endpoint <Uri>
[-AuthenticationMode <NotificationSubscriberAuthMode>]
[-AuthenticationUsername <String>]
[-AuthenticationPassword <String>]
[-Force]
[-EncryptionKey <String>]
[-EncryptionAlgorithm <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-MgmtSvcNotificationSubscriber
[-NotificationSubscriber <NotificationSubscriber>]
-Name <String>
[-Enabled <Boolean>]
[-SubscriberType <NotificationSubscriberType>]
-Endpoint <Uri>
[-AuthenticationMode <NotificationSubscriberAuthMode>]
[-AuthenticationUsername <String>]
[-AuthenticationPassword <String>]
[-Force]
[-EncryptionKey <String>]
[-EncryptionAlgorithm <String>]
[-Database <String>]
[-Server <String>]
[-UserName <String>]
[-Password <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-MgmtSvcNotificationSubscriber
[-NotificationSubscriber <NotificationSubscriber>]
-Name <String>
[-Enabled <Boolean>]
[-SubscriberType <NotificationSubscriberType>]
-Endpoint <Uri>
[-AuthenticationMode <NotificationSubscriberAuthMode>]
[-AuthenticationUsername <String>]
[-AuthenticationPassword <String>]
[-Force]
[-EncryptionKey <String>]
[-EncryptionAlgorithm <String>]
[-ConnectionString <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-MgmtSvcNotificationSubscriber
[-NotificationSubscriber <NotificationSubscriber>]
[-Force]
[-EncryptionKey <String>]
[-EncryptionAlgorithm <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-MgmtSvcNotificationSubscriber cmdlet adds or updates a notification subscriber. If the subscriber does not exist, the cmdlet adds a subscriber. To update an existing notification subscriber, use the Force parameter.
You can run this cmdlet from any computer in the deployment. However, this cmdlet assumes that the database is on the local computer. If the database is on another computer, you must use the Server, UserName, Password, and Database parameters, or a SQL connection string. If you specify a connection string by using the ConnectionString parameter, that value takes precedence over the Server, UserName, Password, and Database parameters.
This cmdlet also assumes that the usage service is installed on the local computer. If the usage service is installed on another computer, you must use the EncryptionKey and EncryptionAlgorithm parameters.
Examples
Example 1: Add a notification subscriber
PS C:\> Set-MgmtSvcNotificationSubscriber -AuthenticationMode None -Enabled $False -Endpoint https://localhost/ -Name "Billing" -SubscriberType BillingService
This command adds a notification subscriber to the database. The command specifies a name and subscriber type for the notification subscriber.
Example 2: Modify a notification subscriber
PS C:\> $Subscriber = Get-MgmtSvcNotificationSubscriber -Name "Billing"PS C:\> $Subscriber.AuthenticationMode = 'Basic'PS C:\> $Subscriber.AuthenticationUsername = 'MyUser'PS C:\> $Subscriber.AuthenticationPassword = 'PassWord'PS C:\> Set-MgmtSvcNotificationSubscriber -NotificationSubscriber $Subscriber -Force
The first command gets the notification subscriber named Billing and stores the object in the $Subscriber variable.
The second, third, and fourth commands make changes to the object stored in the $Subscriber variable.
The last command saves the modified notification subscriber object. Using the Force parameter indicates that the existing subscriber is updated.
Parameters
-AuthenticationMode
Specifies the authentication mode. Valid values for this parameter are:
- None
- Basic
- Windows
Type: | NotificationSubscriberAuthMode |
Accepted values: | None, Basic |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AuthenticationPassword
Specifies a password.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AuthenticationUsername
Specifies a user name.
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 |
-ConnectionString
Specifies an SQL connection string.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Database
Specifies a database name.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Enabled
Indicates whether the notification subscriber is enabled.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EncryptionAlgorithm
Specifies an encryption algorithm.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EncryptionKey
Specifies an encryption key, as a hexadecimal string.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Endpoint
Specifies a URI for the notification subscriber.
Type: | Uri |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Force
Indicates that the cmdlet updates an existing subscriber.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Specifies the name of a notification subscriber.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NotificationSubscriber
Specifies a notification subscriber object. To obtain a notification subscriber object, use the Get-MgmtSvcNotificationSubscriber cmdlet. If you specify a notification subscriber object, the cmdlet changes that object, regardless of the Name parameter.
Type: | NotificationSubscriber |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Password
Specifies a password.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Server
Specifies the name of the computer on which the SQL database resides.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SubscriberType
Specifies a notification subscriber type. Valid values for this parameter are:
- BillingService
- MandatoryService
- OptionalService
Type: | NotificationSubscriberType |
Accepted values: | BillingService, MandatoryService, OptionalService |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserName
Specifies the name of a user account.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
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 |