Applies to: Exchange Server 2013

Topic Last Modified: 2012-09-18

Use the New-RetentionPolicyTag cmdlet to create a retention tag.

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

For information about the parameter sets in the Syntax section below, see Syntax.

Syntax

New-RetentionPolicyTag [-AddressForJournaling <RecipientIdParameter>] [-AgeLimitForRetention <EnhancedTimeSpan>] [-JournalingEnabled <$true | $false>] [-LabelForJournaling <String>] [-MessageClass <String>] [-MessageFormatForJournaling <UseMsg | UseTnef>] [-RetentionAction <MoveToDeletedItems | MoveToFolder | DeleteAndAllowRecovery | PermanentlyDelete | MarkAsPastRetentionLimit | MoveToArchive>] [-RetentionEnabled <$true | $false>] [-RetentionId <Guid>] <COMMON PARAMETERS>
New-RetentionPolicyTag [-ManagedFolderToUpgrade <ELCFolderIdParameter>] <COMMON PARAMETERS>
COMMON PARAMETERS: -Name <String> [-Comment <String>] [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-IgnoreDehydratedFlag <SwitchParameter>] [-IsDefaultAutoGroupPolicyTag <SwitchParameter>] [-IsDefaultModeratedRecipientsPolicyTag <SwitchParameter>] [-LocalizedComment <MultiValuedProperty>] [-LocalizedRetentionPolicyTagName <MultiValuedProperty>] [-MustDisplayCommentEnabled <$true | $false>] [-Organization <OrganizationIdParameter>] [-SystemTag <$true | $false>] [-Type <Calendar | Contacts | DeletedItems | Drafts | Inbox | JunkEmail | Journal | Notes | Outbox | SentItems | Tasks | All | ManagedCustomFolder | RssSubscriptions | SyncIssues | ConversationHistory | Personal | RecoverableItems | NonIpmRoot | LegacyArchiveJournals>] [-WhatIf [<SwitchParameter>]]

Examples

EXAMPLE 1

This example creates the retention policy tag Finance-DeletedItems for the Deleted Items default folder. When applied to a mailbox as a part of a retention policy, the tag permanently deletes items of all types in the Deleted Items folder in 30 days.

Copy Code
New-RetentionPolicyTag "Finance-DeletedItems" -Type DeletedItems -RetentionEnabled $true -AgeLimitForRetention 30 -RetentionAction PermanentlyDelete

EXAMPLE 2

This example creates the default policy tag Finance-Default. When applied to a mailbox as part of a retention policy, the tag permanently deletes all items without a retention tag within 365 days. Items of a particular message class such as Voicemail, for which a default tag (a retention tag of type All) exists, aren't impacted.

Copy Code
New-RetentionPolicyTag "Finance-Default" -Type All -RetentionEnabled $true -AgeLimitForRetention 365 -RetentionAction PermanentlyDelete

EXAMPLE 3

This example creates the retention tag Business Critical of type Personal. When applied to mailbox items as part of a retention policy, the items are permanently deleted in approximately seven years.

Copy Code
New-RetentionPolicyTag "Business Critical" -Type Personal -Comment "Use this tag for all business critical mail" -RetentionEnabled $true -AgeLimitForRetention 2556 -RetentionAction PermanentlyDelete

Detailed Description

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

Retention tags support a display of the tag name and an optional comment in localized languages. Language culture codes from the CultureInfo class are used for this purpose.

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

Name

Required

System.String

The Name parameter specifies the name of the tag.

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

IgnoreDehydratedFlag

Optional

System.Management.Automation.SwitchParameter

This parameter is reserved for internal Microsoft use.

IsDefaultAutoGroupPolicyTag

Optional

System.Management.Automation.SwitchParameter

This parameter is reserved for internal Microsoft use.

IsDefaultModeratedRecipientsPolicyTag

Optional

System.Management.Automation.SwitchParameter

This parameter is reserved for internal Microsoft use.

JournalingEnabled

Optional

System.Boolean

This parameter isn't available in this release.

LabelForJournaling

Optional

System.String

This parameter isn't available in this release.

LocalizedComment

Optional

Microsoft.Exchange.Data.MultiValuedProperty

The LocalizedComment parameter specifies localized comments and their languages. When the user's language setting matches a language specified for this parameter, Microsoft Outlook and Microsoft Office Outlook Web App display the corresponding localized comment. Comments are specified in the form of ISO Language Code:Comment, for example, LocalizedComment EN-US:"This is a localized comment in U.S. English".

LocalizedRetentionPolicyTagName

Optional

Microsoft.Exchange.Data.MultiValuedProperty

The LocalizedRetentionPolicyTagName parameter specifies localized tag names and their languages. When the user's language setting matches a language specified for this parameter, Outlook and Outlook Web App display the corresponding localized tag name. Names are specified in the form of ISO Language Code:Name, for example, LocalizedRetentionPolicyTagName EN-US:"Business Critical".

ManagedFolderToUpgrade

Optional

Microsoft.Exchange.Configuration.Tasks.ELCFolderIdParameter

The ManagedFolderToUpgrade parameter specifies the name of a managed folder to use as a template for a retention tag.

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

Organization

Optional

Microsoft.Exchange.Configuration.Tasks.OrganizationIdParameter

The Organization parameter is reserved for internal Microsoft use.

RetentionAction

Optional

Microsoft.Exchange.Data.Directory.SystemConfiguration.RetentionActionType

The RetentionAction parameter specifies one of the following actions:

  • MarkAsPastRetentionLimit   If you specify this action for a retention tag, messages that have the tag applied are marked as past the retention limit.

  • MoveToFolder   This action isn't available for retention tags.

  • MoveToDeletedItems   This action isn't available for retention tags.

  • 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 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. You can use this action for retention tags of type All, Personal, and RecoverableItems.

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 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 make sure the retention tag found on mailbox items tagged in an on-premises deployment matches the tag when the mailbox is moved to the cloud, or mailbox items tagged in the cloud match the tag when the mailbox is moved to an on-premises Exchange server. The parameter is used in cross-premises deployments. You don't need to specify this parameter in on-premises-only deployments.

SystemTag

Optional

System.Boolean

The SystemTag parameter specifies that the tag is created for internal Exchange functionality.

Type

Optional

Microsoft.Exchange.Data.Directory.SystemConfiguration.ElcFolderType

The Type parameter specifies the type of retention tag being created. Valid values include:

  • Contacts

  • DeletedItems

  • Drafts

  • Inbox

  • JunkEmail

  • Journal

  • Notes

  • Outbox

  • SentItems

  • All

  • RecoverableItems

  • RssSubscriptions

  • SyncIssues

  • ConversationHistory

  • Personal

Note:
To create a default policy tag (DPT), specify type All. Retention tags for the Calendar and Tasks folders aren't supported. For tags of type RecoverableItems, the only valid retention action is MoveToArchive.

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.