Beyond Automation — open source
Stop doing offboarding by hand.
OffboardPilot automates the complete hybrid AD + M365 offboarding workflow in a single guided PowerShell script — six steps, a color-coded reconciliation report, and a full session transcript logged automatically.
Status: Released · v1.0 · Distributed as source from the GitHub repository under the MIT License.
The silent failure
Offboarding scripts can get the EXO groups wrong.
When you remove a user’s M365 license, Exchange Online may revert their primary email address back to [email protected]. A script that filters distribution group memberships by email address after the license removal can hit the wrong address, find nothing, and report success.
The user is still in every cloud DL they were ever added to.
OffboardPilot captures the user’s Exchange Distinguished Name before any license changes, then uses that DN for every group query. DN is stable regardless of licensing state.
Engineering demonstration
See a full offboarding run in a hybrid lab.
The player loads from YouTube in privacy-enhanced mode only after you press play. English captions are available from the CC button.
Want the background first? How to Automate Employee Offboarding Across Active Directory and Microsoft 365 →
What it does
Six steps. One script. Nothing missed.
Disable AD account
Disables the on-premises Active Directory account immediately.
Block Entra ID sign-in
Sets BlockSignIn in Entra ID / Azure AD to prevent cloud authentication.
Revoke M365 sessions
Revokes all active Microsoft 365 sessions and OAuth refresh tokens.
Mailbox conversion
Converts to Shared mailbox, configures forwarding, and removes all assigned licenses.
Remove EXO groups
Removes cloud-only Exchange Online distribution group memberships using the stable DN.
Remove AD groups
Removes on-premises AD group memberships including AD-synced distribution lists.
Built for real hybrid environments
Works out of the box. No configuration required.
- ✓ No hardcoded values — drop it in any environment
- ✓ Handles users with no EXO mailbox — EXO steps skip gracefully, AD steps continue
- ✓ Mailbox size pre-check — warns before conversion if mailbox exceeds 50GB
- ✓ EXO group membership uses Distinguished Name — prevents silent misses after license removal
- ✓ AD operations use explicit admin credentials — supports least-privilege accounts
- ✓ Required modules auto-install on first run
- ✓ Full session transcript logged automatically to C:\Scripts\Logs\
Requirements
- PowerShell 5.1 (recommended) — PS7 compatible
- RSAT Active Directory module
- ExchangeOnlineManagement module
- Microsoft.Graph.Authentication module
- Domain-connected Windows workstation
Documentation & contributing
Install it, test it in a lab, and help improve it.
Clone or download the repository, review the prerequisites in the README, and run the lab guide before using OffboardPilot in production. The most valuable contribution is running a lab test path and reporting what you observed, especially if it differs from the documentation.