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
|
||
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, |
||
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, |
||
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
To create a DPT for voice mail messages, set the
MessageClass parameter to
|
||
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
|
||
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:
If this parameter isn't present and the RetentionEnabled
parameter is set to |
||
RetentionEnabled |
Optional |
System.Boolean |
The RetentionEnabled parameter specifies whether the tag
is enabled. When set to
When you set the RetentionEnabled parameter to
|
||
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:
|
||
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.