Every employee who leaves gets an offboarding ticket. The vendor contact someone invited into a Teams channel two years ago does not.
Guest accounts arrive one at a time, for a good reason, and then nobody owns them. They keep whatever access they were given. Some of them belong to people who left the company that invited them. In a tenant that handles federal contract work, that is an account management problem, and NIST SP 800-171 expects you to limit access to authorized users.
I raised that tenant’s Microsoft Secure Score from 54.5% to 83.6% over several months. Guest accounts were a separate pass, because a score does not tell you which outside people still need to be there.
Step 1: Get the list with last sign-in
This Microsoft Graph PowerShell query pulls every guest along with their last sign-in:
Connect-MgGraph -Scopes "User.Read.All","AuditLog.Read.All"
Get-MgUser -Filter "userType eq 'Guest'" -All `
-Property DisplayName,Mail,CreatedDateTime,SignInActivity |
Select-Object DisplayName, Mail, CreatedDateTime,
@{n='LastSignIn'; e={$_.SignInActivity.LastSignInDateTime}} |
Sort-Object LastSignInSign-in activity is what makes the list useful. Creation date tells you when someone was invited. Last sign-in tells you whether they still show up.
Step 2: Sort them
- Active and still needed, with an internal sponsor who can say why.
- Stale, with no sign-in in a long time.
- Unknown, where nobody internal could name the reason they were invited.
Step 3: Check what they can reach
A stale guest with access to nothing is clutter. A stale guest who still sits in a Team with a SharePoint library behind it is exposure.
Step 4: Remove, then make it repeatable
The June audit came down to six guest accounts. A small number, and still six people outside the company with a standing way in.
The audit fixed the backlog. The checklist is what keeps it from coming back:
- Every guest invitation has a named internal sponsor.
- When an employee leaves, review the guests they sponsored.
- Review stale guests on a fixed schedule.
- Record each removal as evidence for the account management controls.
Offboarding a guest is nobody’s job until you make it somebody’s.