Commands › Exchange Online

New-ManagedContentSettings

Exchange Online ExchangeOnlineManagement New-*

Create managed content settings for managed folders.

Quick start script

# New-ManagedContentSettings — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-ManagedContentSettings
$before | Format-List

# 3. Make the change (dry run first)
New-ManagedContentSettings -Name <String> -FolderName <ELCFolderIdParameter> -MessageClass <String> -WhatIf
New-ManagedContentSettings -Name <String> -FolderName <ELCFolderIdParameter> -MessageClass <String>

# 4. Verify and diff
$after = Get-ManagedContentSettings
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

New-ManagedContentSettings [-Name] <String> -FolderName <ELCFolderIdParameter> -MessageClass <String>
 [-AddressForJournaling <RecipientIdParameter>]
 [-AgeLimitForRetention <EnhancedTimeSpan>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-JournalingEnabled <Boolean>]
 [-LabelForJournaling <String>]
 [-MessageFormatForJournaling <JournalingFormat>]
 [-MoveToDestinationFolder <ELCFolderIdParameter>]
 [-RetentionAction <RetentionAction>]
 [-RetentionEnabled <Boolean>]
 [-TriggerForRetention <RetentionDateType>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (15)

ParameterTypeRequiredWhat it controls
-Name String yes The Name parameter specifies a unique name for the managed content settings.
-FolderName ELCFolderIdParameter yes The FolderName parameter specifies the name or GUID of the managed folder to which the managed content settings apply.
-MessageClass String yes The MessageClass parameter specifies the message type to which any expiration and journaling configuration settings within these content settings apply.
-AddressForJournaling RecipientIdParameter The AddressForJournaling parameter specifies the journaling recipient where journaled messages are sent. You can use any value that uniquely identifies the recipient. For example:
-AgeLimitForRetention 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...
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-DomainController Fqdn The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the domain controller by its fully qualified domain name...
-JournalingEnabled Boolean The JournalingEnabled parameter specifies that journaling is enabled when set to $true.
-LabelForJournaling String The LabelForJournaling parameter specifies a label that's attached to an item. This label is used by the destination store to determine the content of the item and enforce the appropriate policy.
-MessageFormatForJournaling JournalingFormat The MessageFormatForJournaling parameter specifies the message format that an item should be journaled in. You can use the following values:
-MoveToDestinationFolder ELCFolderIdParameter The MoveToDestinationFolder parameter specifies the destination folder for a move action.
-RetentionAction RetentionAction The RetentionAction parameter specifies one of the following actions:
-RetentionEnabled Boolean The RetentionEnabled parameter specifies that retention is enabled when set to $true.
-TriggerForRetention RetentionDateType The TriggerForRetention parameter specifies the date that's considered as the start date for the retention period. An item can reach its retention limit a specific number of days after the item was delivered or after...
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.