Set-CMAlertSubscription

Set-CMAlertSubscription

Changes the properties of an alert subscription.

構文

Parameter Set: SetById
Set-CMAlertSubscription -Id <String> [-AlertId <Int32[]> ] [-EmailAddress <String[]> ] [-LocaleId <Int32> ] [-NewName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetByName
Set-CMAlertSubscription -Name <String> [-AlertId <Int32[]> ] [-EmailAddress <String[]> ] [-LocaleId <Int32> ] [-NewName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetByValueMandatory
Set-CMAlertSubscription -InputObject <IResultObject> [-AlertId <Int32[]> ] [-EmailAddress <String[]> ] [-LocaleId <Int32> ] [-NewName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetSecurityScopeById
Set-CMAlertSubscription -Id <String> -SecurityScopeAction <SecurityScopeActionType> {AddMembership | RemoveMembership} -SecurityScopeName <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetSecurityScopeByName
Set-CMAlertSubscription -Name <String> -SecurityScopeAction <SecurityScopeActionType> {AddMembership | RemoveMembership} -SecurityScopeName <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetSecurityScopeByValue
Set-CMAlertSubscription -InputObject <IResultObject> -SecurityScopeAction <SecurityScopeActionType> {AddMembership | RemoveMembership} -SecurityScopeName <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細説明

The Set-CMAlertSubscription cmdlet changes the properties of an alert subscription object in Microsoft System Center 2012 Configuration Manager. You can change the name of an alert subscription, the email address of the recipient of an alert notification, the Windows locale ID, and the alert ID. You can also change the security scope membership of an alert subscription by adding it to or removing it from a specified security scope.

パラメーター

-AlertId<Int32[]>

Specifies an array of alert identifiers for the subscription.

エイリアス

AlertIds

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-EmailAddress<String[]>

Specifies an email address where you want to send an alert notification. For example, david.chew@contoso.com. You can separate multiple email addresses by using a semicolon.

エイリアス

EmailAddresses

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Id<String>

Specifies the identifier for a subscription object.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-InputObject<IResultObject>

Specifies an alert notification object in Configuration Manager.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-LocaleId<Int32>

Specifies a locale for alert messages. For more information and a list of locale identifiers, see the Locale IDs Assigned by Microsoft topic at https://go.microsoft.com/fwlink/?LinkId=262651.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Name<String>

Specifies the name of an alert subscription object.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-NewName<String>

Specifies a new name for an alert subscription object.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-SecurityScopeAction<SecurityScopeActionType>

Specifies an action for a security scope. Valid values are: AddMembership and RemoveMembership.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-SecurityScopeName<String>

Specifies the name of a security scope. A security scope name can be Default or the name of a custom security scope.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

Example 1: Change the properties of an alert subscription by subscription ID

This command changes the name, email address, Windows locale ID, and alert ID of an alert subscription that has the ID 16777217.

PS C:\> Set-CMAlertSubscription -Id "16777217" -NewName "Subscription02" -EmailAddress "evan.narvaez@contoso.com" -LocaleId 2057 –AlertIds 16777240

Example 2: Change the properties of an alert subscription by subscription name

This command changes the name, email address, Windows locale ID, and alert ID of an alert subscription named Subscription01.

PS C:\> Set-CMAlertSubscription -Name "Subscription01" -NewName "Subscription02" -EmailAddress "elisa.daugherty@contoso.com" -LocaleId 2057 -AlertIds 16777240

Example 3: Change the properties of an alert subscription by using the output from another cmdlet as input

The first command gets an alert subscription object that has the ID 16777310 and stores the object in the $SubObj variable.

The second command changes the properties of the alert subscription object, which include the subscription name, email recipient, locale ID, and alert ID, for the alert notification stored in the $SubObj variable.

PS C:\> $SubObj = Get-CMAlertSubscription -Id "16777310"
PS C:\> Set-CMAlertSubscription -AlertSubscription $SubObj -NewName "Subscription02" -EmailAddress "patti.fuller@contoso.com" -LocaleId 3081 -AlertIds 16777240

Example 4: Add an alert subscription to a security scope

This command adds the alert subscription named Subscription01 to the security scope named Test.

PS C:\> Set-CMAlertSubscription -SecurityScopeAction AddMembership -SecurityScopeName "Test" -Name "Subscription01"

Example 5: Remove an alert subscription from a security scope

This command removes the alert subscription named Subscription01 from the security scope named Test.

PS C:\> Set-CMAlertSubscription -SecurityScopeAction RemoveMembership -SecurityScopeName "Test" -Name "Subscription01"

関連トピック

New-CMAlertSubscription

Get-CMAlertSubscription

Remove-CMAlertSubscription

Set-CMSecurityScope