Offboard a leaver: block sign-in and remove access
In this task you'll stop a leaver signing in and remove their access.
When someone leaves, the account must stop working straight away, but usually shouldn't be deleted on day one: their files, mailbox and audit trail may still be needed. So you block sign-in, revoke sessions (so tokens already issued stop working), and remove the groups, roles and app access they had.
Deleting comes later. A deleted user sits in Deleted users for 30 days and can be restored; after that it's gone for good.
Example. A finance assistant at Larkfield Group leaves on Friday at 17:00. At 17:05 the service desk blocks sign-in, revokes sessions, removes the finance groups and the Helpdesk Administrator role, and notes in the ticket that the account will be deleted after 30 days.
Before you start
You need: User Administrator (Privileged Role Administrator to remove admin roles). Time: 10 minutes.
Where to look
- Home
- Microsoft Entra ID
- Users
- (the user)
- Edit properties
Steps
- Open Microsoft Entra ID, then Users, and select the leaver.
- Select Edit properties, open the Settings tab, untick Account enabled and select Save.Sign-in is now blocked. The account, its files and its history stay.
- Back on the user's Overview, select Revoke sessions and confirm with Yes.Without this, apps that already signed them in can keep working for up to an hour or more.
- Open Groups in the user's menu, tick each group and select Remove memberships.Or remove them from each group's own Members page.
- Open Assigned roles. Select each role and remove the assignment.Admin roles are the most important to remove: a disabled admin account is still a target.
- Open Applications to check for any app access given directly, and note any devices under Devices for IT to collect.
Commands
# Block sign-in
az ad user update --id leaver@<your-domain> --account-enabled false
# Revoke sessions (Microsoft Graph)
USER=$(az ad user show --id leaver@<your-domain> --query id -o tsv)
az rest --method post --url "https://graph.microsoft.com/v1.0/users/$USER/revokeSignInSessions"
# Remove from a group
az ad group member remove --group grp-finance --member-id $USER
Watch out for
- Cost
- Free.
- Security
- Do it at the time they leave, not days later. Revoke sessions as well as blocking sign-in. Check for admin roles, app ownership and anything shared with them personally.
- Common mistakes
- Deleting the account straight away (losing data you may need), or only blocking sign-in and forgetting the groups, roles and sessions.
Clean up
Nothing extra: this task is the clean-up. Delete the account after the agreed waiting period.
Words to know
- Block sign-in
- Turning off Account enabled, so the password no longer works.
- Revoke sessions
- Invalidates the refresh tokens already issued, so apps that are open have to sign in again, and can't.
- Deleted users
- The 30-day recycle bin for user accounts.
Tick off each step and track your progress in the guide.
Open this task in Azure Portal, Hands On