Onboarding & Offboarding PowerShell Script Pack - User Lifecycle Automation for IT Pros and MSPs
Automate user onboarding and offboarding with PowerShell.
This script pack is built for IT professionals, sysadmins, and MSPs managing users in Active Directory and Microsoft 365. From account creation to license removal, you’ll get clean, ready-to-run PowerShell scripts to standardize and streamline your user lifecycle tasks — all documented and production-ready.
📦 Included Scripts
Onboarding Scripts:
Create AD User
Generate a new user in Active Directory with custom OU, password, and display name
Create Home Folder
Create a user folder with proper NTFS permissions
Assign Microsoft 365 License
Provision licenses via MSOL/Graph modules with usage location
Add to M365 Groups
Assign the user to common Teams/Groups automatically
Set Mailbox Permissions
Grant another user full access to a mailbox
Generate Welcome Log
Create a log file noting user onboarding activity
Offboarding Scripts:
Disable AD Account
Immediately disable a user account during offboarding
Remove from AD Groups
Strip all group memberships except baseline security groups
Revoke M365 Sessions
Force global sign-out across Microsoft 365 services
Convert Mailbox to Shared
Preserve mailboxes for handoff or continued access
Export Mailbox (Placeholder)
Instructions for exporting via Compliance Center
Remove M365 License
Deallocate Microsoft 365 licenses and free up resources
Log Offboarding Event
Generate a log file with offboarding details
🧾 What You Get
- 13 .ps1 scripts
- Individual README docs for each script
- Clean folder structure: onboarding + offboarding
- Compatible with AD, AzureAD, and MSOnline modules
💼 Who It’s For
- MSPs managing Windows and M365 user lifecycles
- Internal IT teams onboarding/offboarding staff
- Any sysadmin looking to automate repetitive account tasks
A complete toolkit of ready-to-use PowerShell scripts for automating user onboarding and offboarding tasks. Includes AD user creation, M365 licensing, group management, mailbox actions, and more — all neatly organized and documented.