Library

Guides Quick Fixes Scripts Find a Guide

Tools

Error Decoder Assessment Baselines Free Tools Service status What's Changed

More

AI Certifications For MSPs Recommended Gear Field Kit FAQ About Contact Get Assessment

Offboard a Departing User in Microsoft 365 and Microsoft Entra ID

EntraReady Guides · Practical Microsoft 365 & Entra ID
Last reviewed:
Last verified against Microsoft Learn:

Microsoft's own offboarding series runs in a fixed order: stop sign-in, save mailbox content, wipe or block mobile devices, forward or convert the mailbox, hand OneDrive and Outlook data to someone else, remove the license, and only then delete the account (Remove a former employee (opens in a new tab)). The order matters because several later steps (shared mailbox, forwarding, OneDrive access) need the account to still exist.

Use it when: a planned departure, a contractor ending, or a same-day termination. For a suspected compromise, start with Cut off a compromised or departing user now, then come back here for data handling.

Before you start

Step by step

  1. Run the read-only snapshot below and save the CSV. It records licenses, groups and registered devices before anything changes.
  2. Stop sign-in. In the Microsoft Entra admin center, go to Entra ID > Users > All users, select the user, Account status > Edit, clear Account enabled, Save, then select Revoke sessions on the Overview page (Revoke user access (opens in a new tab)). In the Microsoft 365 admin center the equivalent is Users > Active users > Reset password, then Account > Sign out of all sessions, then Block sign-in (Step 1 (opens in a new tab)).
  3. Disable their devices if they used company devices registered to them (the Graph sample on the revoke page uses Get-MgUserRegisteredDevice then Update-MgDevice -AccountEnabled:$false). For Intune-managed phones and laptops, decide wipe vs retire: see Wipe or retire an Intune device.
  4. Decide what happens to the mailbox. Either convert it to a shared mailbox (keeps existing mail and calendar) or forward new mail to a colleague. Forwarding only sends new mail (Step 4 (opens in a new tab)). To convert: Users > Active users > the user > Mail > Convert to shared mailbox. The mailbox must still be licensed when you convert (Convert a user mailbox (opens in a new tab)). Details in Shared mailboxes.
  5. Cancel their meetings, especially ones that booked rooms or equipment, which stay unavailable until cancelled (Step 4, Cancel Outlook meetings (opens in a new tab)).
  6. Hand over OneDrive. Users > Active users > the user > OneDrive > Create link to files gives you access to copy what's needed. Only the latest version of a file is moved (Step 5 (opens in a new tab)). Check that the user's manager is set: by default the manager automatically gets access to the OneDrive when the user is deleted (OneDrive retention and deletion (opens in a new tab)).
  7. Remove the license on Licenses and Apps, then reduce the license count under Billing > Your products if you won't refill the seat (Step 6 (opens in a new tab)). Skip this if the mailbox is a shared mailbox over 50 GB, which still needs a license.
  8. Delete the account last, and only if you didn't convert the mailbox or set up forwarding. Both need the account as an anchor (Step 4 (opens in a new tab)).

Read-only PowerShell snapshot

Read-only. Module: Microsoft.Graph.Users. Scopes: User.Read.All (user properties, licenses, group membership, registered devices). Run before step 2. Not tested against a live tenant.

Connect-MgGraph -Scopes "User.Read.All"
$upn  = "leaver@contoso.com"
$user = Get-MgUser -UserId $upn -Property "id,displayName,userPrincipalName,accountEnabled,onPremisesSyncEnabled,assignedLicenses,manager" -ExpandProperty manager
$groups  = Get-MgUserMemberOf -UserId $user.Id -All
$devices = Get-MgUserRegisteredDevice -UserId $user.Id -All
[pscustomobject]@{
UPN            = $user.UserPrincipalName
Enabled        = $user.AccountEnabled
Synced         = $user.OnPremisesSyncEnabled
Manager        = $user.Manager.AdditionalProperties.userPrincipalName
LicenseSkuIds  = ($user.AssignedLicenses.SkuId -join '; ')
Groups         = ($groups  | ForEach-Object { $_.AdditionalProperties.displayName }) -join '; '
Devices        = ($devices | ForEach-Object { $_.AdditionalProperties.displayName }) -join '; '
} | Export-Csv ".\offboard-$($user.Id).csv" -NoTypeInformation

User.Read is listed as least privileged for the memberOf and registeredDevices APIs only when you query yourself; reading another user needs User.Read.All or higher (List memberOf (opens in a new tab), List registeredDevices (opens in a new tab)). With limited permissions, some directory objects come back with only their @odata.type, so blank names in the CSV can be a permissions gap, not a missing object.

Gotchas

Check it worked

Roll back

Re-enable Account enabled and reassign the license. A deleted user can be restored for about 30 days, with OneDrive and Outlook content (Step 5 overview table (opens in a new tab), Restore a user). A shared mailbox can be converted back to a regular mailbox from the Exchange admin center (Recipients > Mailboxes > the mailbox > Others > Convert to regular mailbox), then license the account and reset the password (Convert back (opens in a new tab)).

Related on EntraReady: Shared mailboxes, Find and clean up inactive user accounts, Clean up stale devices, Cut off a compromised or departing user now.

← All Guides

Is this still accurate?

Spotted something outdated or wrong on this page? Tell us in a sentence. The page address is sent with it.

Reports go to the EntraReady inbox. Please don’t include passwords or tenant secrets.