JML Lab: joiner/mover/leaver automation with Microsoft Graph PowerShell
The complete identity lifecycle in Microsoft Entra ID through the Graph PowerShell SDK: onboarding with user creation, group and licence assignment, department change, offboarding with disable and delete. Documented with scripts, screenshots from a real tenant and the obstacles that came up while building it.
- User creation, group membership and licence assignment as the joiner chain
- Attribute change on department switch as the mover
- Disable and delete as a two-stage leaver
- Eight documented scripts plus a cheat sheet
One example of the kind of detail you only learn by typing it yourself: disabling an account fails with “positional parameter cannot be found”, because the Graph SDK expects the change as a body object.
# fails
Update-MgUser -UserId $id -AccountEnabled $false
# correct
Update-MgUser -UserId $id -BodyParameter @{ AccountEnabled = $false }