Applies to: Exchange Server 2010 SP3, Exchange Server 2010 SP2

Topic Last Modified: 2012-11-19

Use the Set-RetentionPolicyTag cmdlet to modify the properties of a retention tag.

For more information about retention tags, see Understanding Retention Tags and Retention Policies.

Syntax

Set-RetentionPolicyTag -Identity <RetentionPolicyTagIdParameter> [-AddressForJournaling <RecipientIdParameter>] [-AgeLimitForRetention <EnhancedTimeSpan>] [-Comment <String>] [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-Force <SwitchParameter>] [-JournalingEnabled <$true | $false>] [-LabelForJournaling <String>] [-LegacyManagedFolder <ELCFolderIdParameter>] [-LocalizedComment <MultiValuedProperty>] [-LocalizedRetentionPolicyTagName <MultiValuedProperty>] [-MessageClass <String>] [-MessageFormatForJournaling <UseMsg | UseTnef>] [-MustDisplayCommentEnabled <$true | $false>] [-Name <String>] [-RetentionAction <MoveToDeletedItems | MoveToFolder | DeleteAndAllowRecovery | PermanentlyDelete | MarkAsPastRetentionLimit | MoveToArchive>] [-RetentionEnabled <$true | $false>] [-RetentionId <Guid>] [-SystemTag <$true | $false>] [-WhatIf [<SwitchParameter>]]
Set-RetentionPolicyTag -Mailbox <MailboxIdParameter> [-Comment <String>] [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-Force <SwitchParameter>] [-LegacyManagedFolder <ELCFolderIdParameter>] [-LocalizedComment <MultiValuedProperty>] [-LocalizedRetentionPolicyTagName <MultiValuedProperty>] [-MustDisplayCommentEnabled <$true | $false>] [-Name <String>] [-OptionalInMailbox <RetentionPolicyTagIdParameter[]>] [-RetentionId <Guid>] [-SystemTag <$true | $false>] [-WhatIf [<SwitchParameter>]]

Detailed Description

Retention tags are used to apply message retention settings to folders and items in a mailbox.

You need to be assigned permissions before you can run this cmdlet. Although all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the "Messaging records management" entry in the Messaging Policy and Compliance Permissions topic.

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.Exchange.Configuration.Tasks.RetentionPolicyTagIdParameter

The Identity parameter specifies the name, distinguished name (DN), or GUID of the retention policy tag to be modified.

Mailbox

Required

Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter

The Mailbox parameter specifies a mailbox for assigning opt-in tags.

Important:
You must use this parameter with the OptionalInMailbox parameter.

AddressForJournaling

Optional

Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter

This parameter isn't available in this release.

AgeLimitForRetention

Optional

Microsoft.Exchange.Data.EnhancedTimeSpan

The AgeLimitForRetention parameter specifies the age at which retention is enforced on an item. The age limit corresponds to the number of days from the date the item was delivered, or the date an item was created if it wasn't delivered. If this parameter isn't present and the RetentionEnabled parameter is set to $true, an error is returned.

Comment

Optional

System.String

The Comment parameter specifies a comment for the retention policy tag.

Confirm

Optional

System.Management.Automation.SwitchParameter

The Confirm switch causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You don't have to specify a value with the Confirm switch.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

The DomainController parameter specifies the fully qualified domain name (FQDN) of the domain controller that writes this configuration change to Active Directory.

Force

Optional

System.Management.Automation.SwitchParameter

The Force switch overrides the confirmation prompt displayed by the cmdlet when you use the RetentionId parameter.

JournalingEnabled

Optional

System.Boolean

This parameter isn't available in this release.

LabelForJournaling

Optional

System.String

This parameter isn't available in this release.

LegacyManagedFolder

Optional

Microsoft.Exchange.Configuration.Tasks.ELCFolderIdParameter

The LegacyManagedFolder parameter specifies the name of a managed folder. The retention tag is created by using retention settings from the managed folder and its managed content settings. You can use this parameter to create retention tags based on existing managed folders to migrate users from managed folder mailbox policies to retention policies.

LocalizedComment

Optional

Microsoft.Exchange.Data.MultiValuedProperty

The LocalizedComment parameter specifies the localized comment and language for the retention policy tag. This comment is displayed in Microsoft Outlook based on the user's locale.

LocalizedRetentionPolicyTagName

Optional

Microsoft.Exchange.Data.MultiValuedProperty

The LocalizedRetentionPolicyTagName parameter specifies a localized name for the retention policy tag. This name is displayed in Outlook based on the user's locale.

MessageClass

Optional

System.String

The MessageClass parameter specifies the message type to which the tag applies. If not specified, the default value is set to *.

With the exception of a default policy tag (DPT) for voicemail, Exchange 2010 doesn't support retention tags for different message types. Only tags with a MessageClass of * are supported, and they apply to all message types.

To create a DPT for voice mail messages, set the MessageClass parameter to voicemail and the Type parameter to All.

Note:
A DPT for voice mail messages applies only to Microsoft Exchange Unified Messaging voice mail messages (identified by the PR_MESSAGE_CLASS MAPI property value IPM.Note.Microsoft.Voicemail*).

MessageFormatForJournaling

Optional

Microsoft.Exchange.Data.Directory.SystemConfiguration.JournalingFormat

This parameter isn't available in this release.

MustDisplayCommentEnabled

Optional

System.Boolean

The MustDisplayCommentEnabled parameter specifies whether the comment can be hidden. The default value is $true.

Name

Optional

System.String

The Name parameter specifies the name of the retention policy tag.

OptionalInMailbox

Optional

Microsoft.Exchange.Configuration.Tasks.RetentionPolicyTagIdParameter[]

The OptionalInMailbox parameter is used with the Mailbox parameter to specify opt-in retention tags available to the mailbox.

RetentionAction

Optional

Microsoft.Exchange.Data.Directory.SystemConfiguration.RetentionActionType

The RetentionAction parameter specifies one of the following actions:

  • MarkAsPastRetentionLimit   This action isn't available for retention tags. If you specify this action for a retention tag, messages that have the tag applied aren't deleted or marked as past the retention limit.

  • MoveToFolder   This action isn't available for retention tags. You can't specify this action for a retention tag.

  • MoveToDeletedItems   This action isn't available for retention tags. If you specify this action for a retention tag, messages that have the tag applied aren't deleted or marked as past the retention limit.

  • DeleteAndAllowRecovery   This action deletes a message and allows recovery from the Recoverable Items folder.

  • PermanentlyDelete   This action permanently deletes a message. A message that has been permanently deleted can't be recovered by using the Recoverable Items folder. Permanently deleted messages aren't returned in a Discovery search, unless litigation hold is enabled for the mailbox.

  • MoveToArchive   This action moves a message to the user's archive mailbox.

If this parameter isn't present and the RetentionEnabled parameter is set to $true, an error is returned.

RetentionEnabled

Optional

System.Boolean

The RetentionEnabled parameter specifies whether the tag is enabled. When set to $false, the tag is disabled, and no retention action is taken on messages that have the tag applied.

Note:
Messages with a disabled tag are still considered tagged, so any default policy tags in the user's retention policy aren't applied to such messages.

When you set the RetentionEnabled parameter to $false, the retention period for the tag is shown as Never. Users may apply this tag to items that they want to indicate should never be deleted or should never be moved to the archive. Enabling the tag later may result in unintentional deletion or archiving of items. To avoid this situation, if a retention policy is disabled temporarily, it may be advisable to change the name of that tag so that users are discouraged from using it, such as DISABLED_<Original Name>.

RetentionId

Optional

System.Guid

The RetentionId parameter specifies an alternate tag ID to ensure the retention tag found on mailbox items tagged in one Exchange organization matches the tag when the mailbox is moved to another Exchange organization (for example, in a cross-forest deployment or in a cross-premises deployment, when a mailbox is moved from an on-premises Exchange server to the cloud, or a cloud mailbox is moved to an on-premises Exchange server).

Important:
It's not ordinarily required to specify or modify the RetentionId parameter for a retention tag. The parameter is populated automatically by <scriptname> when importing retention tags in a cross-forest or cross-premises deployment.

SystemTag

Optional

System.Boolean

The SystemTag parameter specifies whether the retention policy tag is created for internal Exchange functionality.

WhatIf

Optional

System.Management.Automation.SwitchParameter

The WhatIf switch instructs the command to simulate the actions that it would take on the object. By using the WhatIf switch, you can view what changes would occur without having to apply any of those changes. You don't have to specify a value with the WhatIf switch.

Input Types

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types. If the Input Type field for a cmdlet is blank, the cmdlet doesn’t accept input data.

Return Types

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types. If the Output Type field is blank, the cmdlet doesn’t return data.

Examples

EXAMPLE 1

This example changes the comment for the AllUsers-DeletedItems retention policy tag.

Copy Code
Set-RetentionPolicyTag "AllUsers-DeletedItems" -Comment "Items in the Deleted Items folder will be automatically deleted in 120 days"

EXAMPLE 2

This example makes optional retention tags available to user Terry Adams using the Mailbox and OptionalInMailbox parameters.

Copy Code
Set-RetentionPolicyTag -Mailbox "Terry Adams" -OptionalInMailbox "ProjectA","ProjectB"