Set-MgmtSvcNotificationSubscriber

Set-MgmtSvcNotificationSubscriber

Adds or updates a notification subscriber.

Syntax

Parameter Set: ByProperties
Set-MgmtSvcNotificationSubscriber -Endpoint <Uri> -Name <String> [-AuthenticationMode {None | Basic} ] [-AuthenticationPassword <String> ] [-AuthenticationUsername <String> ] [-Enabled <Boolean> ] [-EncryptionAlgorithm <String> ] [-EncryptionKey <String> ] [-Force] [-SubscriberType {BillingService | MandatoryService | OptionalService} ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByObject
Set-MgmtSvcNotificationSubscriber [[-NotificationSubscriber] <NotificationSubscriber> ] [-EncryptionAlgorithm <String> ] [-EncryptionKey <String> ] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ConnectionParameters
Set-MgmtSvcNotificationSubscriber -Endpoint <Uri> -Name <String> [-AuthenticationMode {None | Basic} ] [-AuthenticationPassword <String> ] [-AuthenticationUsername <String> ] [-Database <String> ] [-Enabled <Boolean> ] [-EncryptionAlgorithm <String> ] [-EncryptionKey <String> ] [-Force] [-NotificationSubscriber <NotificationSubscriber> ] [-Password <String> ] [-Server <String> ] [-SubscriberType {BillingService | MandatoryService | OptionalService} ] [-UserName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ConnectionString
Set-MgmtSvcNotificationSubscriber -Endpoint <Uri> -Name <String> [-AuthenticationMode {None | Basic} ] [-AuthenticationPassword <String> ] [-AuthenticationUsername <String> ] [-ConnectionString <String> ] [-Enabled <Boolean> ] [-EncryptionAlgorithm <String> ] [-EncryptionKey <String> ] [-Force] [-NotificationSubscriber <NotificationSubscriber> ] [-SubscriberType {BillingService | MandatoryService | OptionalService} ] [-Confirm] [-WhatIf] [ <CommonParameters>]


 

Detailed 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.

Parameters

-AuthenticationMode<NotificationSubscriberAuthMode>

Specifies the authentication mode. Valid values for this parameter are:

-- None

-- Basic

-- Windows

The acceptable values for this parameter are:

 

None

 

Basic

 

 

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-AuthenticationPassword<String>

Specifies a password.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-AuthenticationUsername<String>

Specifies a user name.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-ConnectionString<String>

Specifies an SQL connection string.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Database<String>

Specifies a database name.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Enabled<Boolean>

Indicates whether the notification subscriber is enabled.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-EncryptionAlgorithm<String>

Specifies an encryption algorithm.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-EncryptionKey<String>

Specifies an encryption key, as a hexadecimal string.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Endpoint<Uri>

Specifies a URI for the notification subscriber.

 

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Force

Indicates that the cmdlet updates an existing subscriber.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Name<String>

Specifies the name of a notification subscriber.

 

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-NotificationSubscriber<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.

 

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

 

-Password<String>

Specifies a password.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Server<String>

Specifies the name of the computer on which the SQL database resides.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-SubscriberType<NotificationSubscriberType>

Specifies a notification subscriber type. Valid values for this parameter are:

-- BillingService

-- MandatoryService

-- OptionalService

The acceptable values for this parameter are:

 

BillingService

 

MandatoryService

 

OptionalService

 

 

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-UserName<String>

Specifies the name of a user account.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Confirm

Prompts you for confirmation before executing the command.

 

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

 

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.

Examples

Example 1: Add a notification subscriber

This command adds a notification subscriber to the database. The command specifies a name and subscriber type for the notification subscriber.

PS C:\> Set-MgmtSvcNotificationSubscriber -AuthenticationMode None -Enabled $False -Endpoint https://localhost/ -Name "Billing" -SubscriberType BillingService

 

Example 2: Modify a notification subscriber

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.

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

 

Related topics

Get-MgmtSvcNotificationSubscriber

Remove-MgmtSvcNotificationSubscriber