Skip to main content
Joinly by KoppelHet

Entra ID and Active Directory

An employee leaves: when do you remove the Microsoft 365 licence?

A colleague leaves and the licence can go back into the pool. Yet removing the Microsoft 365 licence the moment an employee leaves is not always wise: what happens to the mailbox, shared files and OneDrive? With the right order you avoid losing important information, and you avoid an account keeping access it no longer needs.

Removing a licence can affect data too

When someone leaves, you want to save costs and close off access. But removing the Microsoft 365 licence when an employee leaves also has consequences for email and files. That is why the order matters.

Removing a licence feels like an administrative task, but it is also a decision about data. The licence is what keeps the mailbox and OneDrive alive. If you remove the licence first when someone leaves and only then realise the manager still needed the mail, you are too late once those 30 days have passed. So first what exactly happens at each step, and then the order (and where convert to shared mailbox fits in).

Three actions, three consequences
What you doMailboxOneDrive
Block sign-inStays in place and keeps receiving mailStays in place; the clean-up does not start
Remove the licenceKept for 30 days, then deleted (except what a retention policy holds). No longer searchable with eDiscovery.Stays in place, but counts as unlicensed: read-only after 60 days, archived after 93 days
Delete the accountRecoverable for 30 days by restoring the account, then gone. With a hold it becomes an inactive mailbox.The retention period starts (30 days by default). The manager gets access and an email, then 93 days in the recycle bin

There is one more thing for OneDrive: when an account is deleted, Microsoft automatically gives access to the manager from Entra ID. If the account has no manager, access goes to the secondary owner you set in the SharePoint admin center. If there is no secondary owner either, nobody gets access and nobody is warned that the files are about to disappear.

First close off access, then secure the data

Good offboarding prevents two problems at once: a former employee keeps no access, and colleagues lose no information they still need.

The principle: close the door first, then secure the data, only then free up the licence, and the account last of all. In steps, it looks like this.

  1. Close off access. Block sign-in and revoke the sessions, so that a phone or laptop that is already signed in is logged out too. If the account comes from on-premises Active Directory, disable it there; otherwise the synchronisation switches it back on.
  2. Decide what you keep. Does the mail need to stay for colleagues (convert to a shared mailbox), for laws or regulations (retention policy or litigation hold, see below), or not at all?
  3. Convert the mailbox to a shared mailbox while the licence is still assigned. Without a licence you will not see the option.
  4. Give the manager or successor access to the shared mailbox and set an automatic reply that points to the right colleague.
  5. Sort out OneDrive. Have the manager or successor move the files that are still needed to a SharePoint site or their own OneDrive.
  6. Reset the password. After the conversion, the old username and password keep working on the shared mailbox.
  7. Remove the licence, but only if the mailbox is under 50 GB and does not need a hold.
  8. Delete the account later, or not at all. A converted shared mailbox needs the account as its anchor, so do not delete it while you are using the mailbox.
Steps 1 and 3 to 7 in PowerShell (Microsoft Graph and Exchange Online)
Connect-MgGraph -Scopes "User.ReadWrite.All","Organization.Read.All"
Connect-ExchangeOnline

$upn = "jan.jansen@bedrijf.nl"

# 1. Close off access
Update-MgUser -UserId $upn -AccountEnabled:$false
Revoke-MgUserSignInSession -UserId $upn

# 3. Convert, check the size first
Get-MailboxStatistics -Identity $upn | Select-Object DisplayName, TotalItemSize
Set-Mailbox -Identity $upn -Type Shared

# 4. Add the manager and set an automatic reply
Add-MailboxPermission -Identity $upn -User "petra.devries@bedrijf.nl" -AccessRights FullAccess -InheritanceType All
Set-MailboxAutoReplyConfiguration -Identity $upn -AutoReplyState Enabled -InternalMessage "Jan werkt hier niet meer. Neem contact op met Petra de Vries." -ExternalMessage "Jan werkt hier niet meer. Neem contact op met Petra de Vries."

# 7. Free up the licence
$sku = Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq "SPE_E3"
Set-MgUserLicense -UserId $upn -AddLicenses @() -RemoveLicenses @($sku.SkuId)

Keeping the mailbox for colleagues: when can you?

A shared mailbox is often a practical solution, for example when customers still reply to old emails.

Converting to a shared mailbox (convert to shared mailbox) is the usual way to keep the mail of an employee who has left without continuing to pay for a licence. All mail and calendar items stay in place. In the admin center you go to Users > Active users, choose the user and, on the Mail tab, Convert to shared mailbox. A few conditions do apply.

ConditionWhat it means
Licence before convertingIf you have already removed the licence, assign it again first. After that it can come off.
Up to 50 GB without a licenceIf the mailbox is larger, clean it up or assign Exchange Online Plan 2; the limit is then 100 GB.
Archive and litigation holdRequire a licence on the shared mailbox: Exchange Online Plan 2, or Plan 1 with the Exchange Online Archiving add-on.
The account staysThe user account is the anchor of the shared mailbox. Do not delete it.
Sign-in blockedA shared mailbox is not meant to be signed in to directly. Keep sign-in blocked for the account.
Up to 25 usersIf more people open the mailbox at the same time, they may see connection errors or duplicate messages.

Whoever opens the shared mailbox does need an Exchange Online licence of their own; the shared mailbox itself does not. Which permissions to give the manager, and why automapping through a group does not work, is covered in shared mailboxes and mailbox permissions. In a hybrid Exchange environment you convert the mailbox with the cmdlets of your on-premises Exchange; otherwise the synchronisation may turn it back into a user mailbox.

When you keep the licence

Freeing up the licence is not always the right choice. In these cases you keep it, or you take a different route:

  • Litigation hold or an ongoing investigation. A mailbox without a licence can no longer be searched with eDiscovery, and a hold on a shared mailbox requires a licence on that mailbox.
  • A mailbox larger than 50 GB that you want to keep as a shared mailbox: that requires Exchange Online Plan 2.
  • An archive mailbox that has to come along: without a licence the shared mailbox has no larger archive.
  • OneDrive you want to keep accessible for longer than 93 days without moving the files. After 93 days without a licence it is in the archive.

If you only need to keep the mail for compliance and nobody needs to work in it, an inactive mailbox is often better than continuing to pay for a licence. You put a retention policy on the mailbox, check that the hold has really been applied, and then delete the account. The mailbox is then kept for as long as the policy says, and the licence is freed up. Microsoft recommends a retention policy for this rather than litigation hold.

Why this gets forgotten in manual offboarding

The last working day is busy. Without fixed steps, removing a licence quickly comes loose from keeping the right data.

Every step above is easy enough to do. The problem is that there are eight of them, in a fixed order, on a fixed day, and that IT usually only hears about that day if someone remembers to pass it on. A leaver who comes in a week late means an active account for a week, or a licence that was already gone before the mailbox was converted. A leaver who never comes in at all means a licence that keeps running for months; that is what reducing Microsoft 365 licence costs is about.

The full offboarding story in Entra ID, with devices, MFA methods and applications outside Microsoft 365, is in offboarding in Entra ID. Why it is precisely when people leave that things so often get left undone, you can read in automatic deprovisioning.

Joinly

Make leaving a fixed process

A departure is more than removing a licence. You want to close off access first, then decide what needs to happen to the mailbox and files, and only then free up licences.

Joinly can use the leave date from HR to start the offboarding. In a workflow you set which actions may happen automatically and which need approval or follow-up first, for example around keeping the mailbox. That way nobody has to remember which steps are still open.

Een workflow in Joinly met triggers, condities en actiesRead how Joinly supports offboarding

What you can count on

  • No vendor lock-inYour identities and your configuration stay yours.
  • Your data out whenever you wantYou can export your data at any time.
  • Standard SLAOur standard SLA is available on request.
  • Support during implementationOur specialists set it up together with you.
  • ISO 27001 certifiedInformation security to an internationally recognised standard.

Removing licences when employees leave

Frequently asked questions

  • What happens to the mailbox when I remove the licence?

    The data in Exchange Online is kept for 30 days and then deleted, except what a retention policy or label holds. During those 30 days the mailbox can no longer be searched with eDiscovery either. If you want to keep the mail, convert the mailbox to a shared mailbox first.

  • Can I convert a mailbox to a shared mailbox without a licence?

    No. The user mailbox must have a licence at the moment you convert it; otherwise you will not see the option. If you have already removed the licence, assign it again first. After the conversion it can come off, as long as the mailbox is under 50 GB and does not need a hold.

  • What happens to OneDrive when someone leaves?

    As long as the account exists, OneDrive stays in place. Without a licence it becomes read-only after 60 days and is archived after 93 days. If you delete the account, the retention period starts (30 days by default) and the manager automatically gets access and an email.

  • Can I delete the account after converting to a shared mailbox?

    No, not while you are using the shared mailbox. The account is the anchor of the mailbox. Keep sign-in blocked and reset the password, because otherwise the old credentials keep working.

  • How do I keep a former employee's mail without a licence?

    As a shared mailbox up to 50 GB, or as an inactive mailbox: put a retention policy on the mailbox, check that the hold has been applied and then delete the account. The mail is then kept for as long as the policy determines.

Try Joinly on top of your own Microsoft environment

Roles, workflows, external staff and an audit log for Entra ID and Active Directory. Start with demo data in the free trial environment.

No credit card, nothing to install.

Rather talk to someone first? Talk to an IAM specialist