Skip to content
Tech Shizz Logo

An Engineers Blog

  • TechShizz
  • blog

Office 365: Retention Tags and Policies

Posted on February 23, 2021 By rich No Comments on Office 365: Retention Tags and Policies

Retention Tag Types

  • Default policy tags – Automatically applied to an entire mailbox which has no other tags set.
  • Retention policy tags – Are applied to the default folders like ‘Inbox’ and ‘Calendar’.
  • Personal Tags – Set manually through user assignments to both messages and folders.
Retention tags are linked to a retention policy and then the policy is linked to user mailboxes.

Power Shell

Connect to MSOnline Power Shell Module

Connect-MsolService

Create a new retention tag

New-RetentionPolicyTag "Tag Name" -Type -AgeLimitForRetention -RetentionAction

New Retention Policy

New-RetentionPolicy -RetentionPolicyTagLinks

Change Policy for all Mailboxes

Get-Mailbox -ResultSize unlimited | Set-Mailbox -RetentionPolicy "RetentionPolicyName"

Change old retention policy to new one

$OldPolicy = {Get-RetentionPolicy "Old-Retention-Policy"}.distinguishedName
Get-Mailbox -Filter {RetentionPolicy -eq $OldPolicy} -Resultsize Unlimited | Set-Mailbox -RetentionPolicy "New-Retention-Policy"

How do we know it worked?

Get-Mailbox "Mailbox Name" | Select-RetentionPolicy

If we need to force the retention process to run for some reason this can be done with a power shell command only. The process which does the retention actions is called the ‘Managed Folder Assistant’ and is run periodically by default.

Start-ManagedFolderAssistant -Identity "Username"

Place a mailbox on retention hold

Set-Mailbox "Username" -RetentionHoldEnabled $true

Post navigation

❮ Previous Post: Office 365: Security, Distribution and Dynamic Distribution groups – (Power Shell)
Next Post: How to disable SharePoint Online Access for a specific department in Office 365 using PowerShell ❯

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Subscribe to our newsletter!

Recent Posts

  • How to implement a lightning-fast ransomware playbook
  • How to achieve defence in depth in your business
  • How to implement a SecOps team phishing response plan
  • How to block an Office 365 Sign-in correctly
  • Microsoft finally patched serious Exchange 0-day over a month old!

Recent Comments

    Archives

    • November 2022
    • July 2021
    • March 2021
    • February 2021

    Categories

    • Cyber Security
    • Uncategorized

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org

    Copyright © 2023 .

    Theme: Oceanly News Dark by ScriptsTown