Guidechecked
M365 onboarding and offboarding
Set up new employees in Microsoft 365 properly and remove them properly when they leave. With groups, licenses, MFA, PowerShell and a checklist for small and medium-sized companies.
Why a fixed process
An account that is still active after someone leaves is an open door. A license nobody uses costs money every month. And anyone who sits there on day one without a mailbox or Teams access has a poor start. All three problems have the same cause: every case is handled differently. That is why I work with a fixed process that is the same for every person and can be ticked off.
Preparation
The process does not start in the admin center but with clear rules. Once they are in place, every new account is ready in a few minutes.
- Roles: who creates accounts? For daily work the User Administrator and License Administrator roles are enough. Global Administrator only for emergencies.
- Define a naming scheme, for example firstname.lastname@firma.example. Transliterate umlauts (ü becomes ue), and have a fixed rule for duplicates.
- Group concept: permissions and licenses are tied to groups, not to people. One group per department and one per license bundle.
- Checklist with HR: name, start date, department, job title, manager, required license and devices. When someone leaves: last working day and who takes over the mailbox and files.
Users firstname.lastname@firma.example
Departments ABT-Sales, ABT-Accounting
Licenses LIZ-M365-Standard, LIZ-M365-Premium
Mailboxes info@firma.example, invoices@firma.exampleCreating the user
For single accounts the Microsoft 365 admin center is enough. There you go to Users, Active users and select Add a user. The same works in the Microsoft Entra admin center under Users, All users, New user. Menu names are given as they appear in the English interface.
- Enter first name, last name, display name and username according to the naming scheme, then pick the domain.
- Let the password be generated automatically and keep “Require this user to change their password when they first sign in” enabled.
- Set the location (usage location). Without it no license can be assigned.
- Under Profile info fill in department, job title and manager. The address book, dynamic groups and later the offboarding all rely on this.
Caution:Never send the initial password by email to the new address, nobody can read it there yet. Hand it over in person or through a second channel, separately from the username.
Assigning licenses through groups
Instead of assigning each license by hand, a group receives the license. Anyone who becomes a member gets it automatically, anyone who leaves the group loses it. Microsoft calls this group-based licensing. It works with security groups, mail-enabled groups and Microsoft 365 groups. It requires Entra ID P1, which is included in Microsoft 365 Business Premium and E3, for example.
- In the admin center open Billing, Licenses and select Assign licenses.
- Search for the license group, pick the subscription and, if needed, turn off individual services under Turn apps and services on or off.
- Check for errors on the product’s Errors & issues tab, for example when licenses run out.
Tip:Nested groups are not considered for licensing, only direct members get the license. When moving someone between two license groups, add them to the new group first, then remove them from the old one, otherwise they are briefly unlicensed.
Groups, Teams and SharePoint
Behind every team there is a Microsoft 365 group with its own SharePoint site. Members of the group see the team, files and calendar. That is why I grant access only through groups and never directly on individual folders. When someone leaves, removing them from the groups is enough, and no forgotten folder permission is left behind.
Tip:Every team needs at least two owners. If the only owner leaves, nobody can manage members without IT stepping in.
Setting up the mailbox
The mailbox is created automatically as soon as a license with Exchange Online is assigned. Then come the details people notice when they are missing.
- Add aliases, for example for old spellings or a short address.
- Keep the signature consistent, ideally managed centrally instead of by each person.
- Grant access to shared mailboxes such as info@firma.example through the department group or individually as needed.
Security from day one
MFA is mandatory, no exceptions. The easiest option is the Microsoft Authenticator app. Without Entra ID P1, security defaults turn on MFA for everyone. With P1, for example in Microsoft 365 Business Premium, you control it more precisely with Conditional Access, for example MFA always and sign-in only from managed devices.
- Set up the Authenticator app together on day one, not through instructions in the mailbox.
- Instead of an initial password you can use a Temporary Access Pass. The person signs in once with it and registers their methods.
- Enable self-service password reset (SSPR) so forgotten passwords do not end up at the help desk.
Caution:Create at least two emergency admin accounts that are excluded from Conditional Access policies. Otherwise one wrong policy can lock you out yourself.
Devices
With Intune and Windows Autopilot the laptop reaches the person still in its original packaging. After the first sign-in it pulls policies, apps and settings by itself. The requirement is that the device was registered with Autopilot beforehand, by the reseller or via its hardware hash. Without Intune you set up the device manually: sign in the user, updates, Office, disk encryption. Then you record the serial number and the person in the inventory list.
Automating with PowerShell
Once you create a few accounts a month, a script pays off. The Microsoft Graph PowerShell module replaces the old AzureAD and MSOnline modules. The example creates a user and adds them to the license group. The license then comes through the group.
# One time: Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "User.ReadWrite.All","Group.ReadWrite.All"
$pw = @{
Password = "<INITIAL-PASSWORD>"
ForceChangePasswordNextSignIn = $true
}
$user = New-MgUser -DisplayName "Max Muster" -GivenName "Max" -Surname "Muster" `
-UserPrincipalName "max.muster@firma.example" -MailNickname "max.muster" `
-UsageLocation "DE" -Department "Sales" -JobTitle "Inside sales" `
-PasswordProfile $pw -AccountEnabled
# Find the license group and add the user
$grp = Get-MgGroup -Filter "displayName eq 'LIZ-M365-Standard'"
New-MgGroupMember -GroupId $grp.Id -DirectoryObjectId $user.IdTip:Read the data from a CSV file with Import-Csv and let the script process one row per person. Never store a real password in the script.
Offboarding: block access immediately
On the last working day, or immediately if the separation is contentious, you close all access first. Blocking alone is not enough: according to Microsoft it can take up to 24 hours, and existing sessions keep running until their access token expires.
- Reset the password. This takes effect immediately.
- Block sign-in.
- On the Account tab select Sign out of all sessions, or revoke all sessions with PowerShell.
- Remove company data from the phone through Intune (Retire), or fully reset a company device (Wipe).
Connect-MgGraph -Scopes "User.ReadWrite.All"
$upn = "max.muster@firma.example"
# Block sign-in and end all sessions
Update-MgUser -UserId $upn -AccountEnabled:$false
Revoke-MgUserSignInSession -UserId $upn
# Save group memberships for the records before removing them
Get-MgUserMemberOf -UserId $upn -All |
Select-Object Id, @{n="Name"; e={$_.AdditionalProperties.displayName}} |
Export-Csv ".\groups-max.muster.csv" -NoTypeInformationOffboarding: data, mailbox and license
Next, the goal is that no work is lost and no license keeps running without need. The order matters, because some steps only work while the license is still assigned.
- Convert the mailbox: on the Mail tab select Convert to shared mailbox. The license must still be assigned for this. In PowerShell use Set-Mailbox -Identity max.muster@firma.example -Type Shared.
- Alternatively set up forwarding (Manage email forwarding). It only covers new emails, not the old ones.
- Hand over OneDrive: on the OneDrive tab use Create link to files to get access and move the needed files into the team’s storage.
- Remove the person from all groups, have their meetings cancelled and delete their devices in Intune and Entra ID.
- Remove the license. A shared mailbox needs no license up to 50 GB.
Caution:Do not delete the account while a shared mailbox or forwarding depends on it. After deletion, OneDrive is kept for only 30 days by default. If legal retention periods apply, set up retention or a litigation hold in Microsoft Purview first. A hold on a shared mailbox requires Exchange Online Plan 2, or Plan 1 with the archiving add-on.
Documentation and proof
Every joiner and leaver gets an entry: who, when, which steps, done by whom. That is your proof in an audit or a data protection request. A ticket with the checklist as a template is entirely enough. The admin actions themselves are also recorded in the audit log in Microsoft Purview.
Common mistakes and fixes
These cases come up again and again.
- License cannot be assigned: the location is missing. Set the usage location and try again.
- Convert to shared mailbox is missing: the license was already removed. Assign it again briefly, convert, then remove it.
- Former employees can still open the mailbox: after the conversion, the username and password keep working. Always reset the password and block sign-in.
- Synced accounts: if users come from an on-premises Active Directory, you block and delete them there, not in Microsoft 365.
Short checklist
The short version to tick off. Onboarding first, offboarding below.
- HR data complete, account follows the naming scheme, location set.
- License and department groups assigned, mailbox, aliases and signature checked.
- MFA set up, device handed over and recorded in the inventory.
- On leaving: password reset, sign-in blocked, sessions revoked, device wiped.
- Mailbox converted, OneDrive handed over, groups removed, license freed, retention settled, ticket closed.
More notes
- NoteLizenzen über Gruppen zuweisen: gruppenbasierte Lizenzierung in Entra IDWer Microsoft-365-Lizenzen pro Benutzer zuweist, pflegt jede Lizenz an jedem Konto von Hand. Bei jedem Eintritt, Abteilungswechsel und Austritt muss jemand daran denken. Mit gruppenbasierter Lizenzierung hängt die Lizenz an einer Gruppe: Wer Mitglied wird, bekommt sie, wer die Gruppe verlässt, verliert sie wieder.
- NoteOffboarding in Microsoft 365 mit PowerShell und Microsoft GraphVerlässt jemand die Organisation, sollen in kurzer Zeit mehrere Dinge passieren: Die Anmeldung wird gesperrt, laufende Sitzungen enden, das Postfach bleibt für Kollegen erreichbar, Lizenzen werden frei und Gruppenmitgliedschaften verschwinden. Von Hand im Admin Center vergisst man dabei leicht einen Schritt. Ein kurzes Skript macht es jedes Mal gleich.
- NoteConditional Access einführen, ohne sich auszusperrenConditional Access ist mächtig, und genau das macht es riskant. Eine einzige Richtlinie mit „Alle Benutzer, alle Ressourcen, Zugriff blockieren“ sperrt die ganze Organisation aus, die Admins eingeschlossen. Die meisten Probleme entstehen nicht durch exotische Einstellungen, sondern weil eine Richtlinie direkt scharf geschaltet wird, ohne sie vorher zu testen.