Microsoft 365

Introduction

In today’s digital workplace, managing user accounts in cloud-based services like Office 365 (O365) is a critical task for IT administrators. Ensuring that users are properly offboarded when they leave an organization is not just about security. It's also about maintaining compliance, preserving important data, and ensuring that business operations continue smoothly.

Removing a user from O365 involves more than just deleting their account; it requires a structured approach to safeguarding data, managing licenses, and ensuring that all access is thoroughly revoked. This article will guide you through the best practices for efficiently and securely removing a user from O365, helping you avoid common pitfalls and ensuring a seamless transition.

If Litigation hold/retention policies are not enabled,

Cloud-Only User

Note. If the user mailbox is not converted to a shared mailbox, and if you remove the user's license, the user's mailbox data is retained for only 30 days. After 30 days, the data is permanently removed.

Hybrid User

If Litigation hold/retention policies are enabled,

Cloud Only User

Note. Before deleting the account, confirm that the hold is successfully applied to the mailbox.

It can be a Microsoft 365 retention policy, retention labels, eDiscovery hold, Litigation hold, or an existing In-Place Hold.

Litigation hold remains supported as an alternative method to retain content in a mailbox and make it inactive after a user account is deleted. However, Microsoft recommends using Microsoft 365 retention instead.

Mailbox

Hybrid Users

If litigation/Retention policies are enabled when the user account moves to an Unsync OU, the User mailbox will be converted to an Inactive mailbox automatically.

Litigation Hold PS Commands

  1. Check Whether a User Mailbox Has Litigation Hold: Get-Mailbox [email protected] | FL LitigationHold*
  2. Extracting List of Users with Litigation Hold Enabled and Without: Get-Mailbox -ResultSize Unlimited | FL LitigationHold*
  3. Enable Litigation Hold for a Specific User: Set-Mailbox -Identity [email protected] -LitigationHoldEnabled $True.
  4. Enable Litigation Hold for All Users: Get-Mailbox -ResultSize Unlimited -Filter "RecipientTypeDetails -eq 'UserMailbox'" | Set-Mailbox -LitigationHoldEnabled $true -LitigationHoldDuration 3650
  5. Assign Litigation Hold to Users Who Have Not Enabled Before: Get-Mailbox | Where {$_.LitigationHoldEnabled -match "False"} | ForEach-Object { $Identity = $_.alias; Set-Mailbox -Identity $Identity -LitigationHoldEnabled $True}

Note. You can't recover or restore an inactive mailbox that's configured with an auto-expanding archive. If, for compliance reasons, you need to recover data from an inactive mailbox with an auto-expanding archive, use content search to export the data from the mailbox. This action is supported for eDiscovery purposes only and can't be used as a backup solution.