The current process is straightforward enough that it works: HR sends an email, you log into the admin portal, you manually create the user, assign the license, and move on. It works until you have three new starters in the same week, or someone is out when the email arrives, or the email comes in at 4pm on a Friday before a Monday start date.
Manual account creation from email requests is one of the most common things IT teams automate first — and for good reason. The process is repetitive, the inputs are always the same, and the cost of getting it wrong (a new hire with no access on day one) is immediately visible to everyone.
If you're looking for a step-by-step path to automate your Office 365 and Active Directory user onboarding, here's what that looks like in practice.
What Teams Try Before Building a Proper Automation
The first stop for most sysadmins is PowerShell. There are good scripts available for M365 account creation and offboarding, and they work well for straightforward scenarios. The limitation is that PowerShell still requires a trigger — someone has to run the script, or you have to schedule it against a data source that may or may not stay current. When the HR system changes its export format or a new attribute needs to flow through, the script needs to be updated by whoever understands it, which is often just one person.
Power Automate is a cleaner approach for teams already in the M365 ecosystem. A flow that monitors a SharePoint list or processes an HR export can trigger account creation without anyone manually running a script. The limitation noted in this thread applies: Power Automate's M365 provisioning flows work well for cloud-only environments. Hybrid environments — where you need to create accounts in on-premises Active Directory and sync to Azure — need additional configuration and often fall back to the PowerShell layer for the on-prem piece.
Microsoft's Entra Lifecycle Workflows are worth evaluating if your licensing includes them. They handle joiner-mover-leaver scenarios natively within the Entra ecosystem, particularly for cloud-only or well-integrated hybrid setups. The constraint is that they work within Microsoft's identity layer — for downstream SaaS applications beyond M365, the automation doesn't extend automatically.
The broader pattern across all of these: they handle the M365 and AD piece, and the non-Microsoft SaaS tools each need their own solution or manual process. That's fine for small stacks. As the application count grows, the per-app problem compounds.
One commenter in this thread made the point directly: every homemade onboarding script hits a breaking point with growth. The moment when it breaks is usually not a good moment — it's when IT is already stretched and a new hire is waiting on access.
Step-by-Step: How to Automate M365 and AD Account Creation From Your HR System
The architecture that removes the manual email trigger entirely connects your HR system directly to your provisioning layer, so the moment HR adds a new hire, the account creation starts automatically.
Step 1: Connect your HR system as the source of truth.
Instead of waiting for an email, Zluri connects directly to your HRMS — BambooHR, Workday, Personio, HiBob, or others — and treats it as the authoritative data source for new hire information. When HR enters a new employee with a start date, name, department, and job title, Zluri fetches that data automatically. No email, no manual trigger, no dependency on someone remembering to notify IT.
Step 2: Connect Microsoft 365 and Active Directory.
For Microsoft 365, Zluri authenticates with your M365 environment via admin API access. For on-premises Active Directory in a hybrid setup, Zluri deploys a lightweight Directory Agent — an outbound-only Docker container installed on your internal network — that creates a secure bridge for reading and writing user data to AD without opening inbound firewall rules.
Step 3: Build an Onboarding Playbook.
A playbook is a reusable template of provisioning actions. For a standard M365 and AD onboarding, the playbook includes an action to create the Microsoft 365 user account and assign the correct license, and an action to create the on-premises AD account with the appropriate group memberships and OU placement.
Dynamic variables handle the data injection automatically. Rather than typing the user's name or email into each action, the playbook uses variables — {{user.user_name}}, {{user.user_email}}, {{user.user_department_name}} — that pull the exact values from the HR system at runtime. The same playbook runs correctly for every new hire without modification.
Step 4: Set up an automation rule to trigger the playbook.
The automation rule is the connection between the HR event and the playbook execution. The trigger is set to fire when a new user is identified from the HR source, or when a user is marked for onboarding. Conditional logic lets you run different playbooks based on department or role — Sales gets a different default access set than Engineering, for example — without building separate flows for each case.
The execution timing can be set to run immediately on HR data detection, or scheduled to run automatically on the specific onboarding date in the HR record. A new hire added to the HR system two weeks before their start date can have their account created and ready on day one without any IT action in between.
Step 5: The email process is gone.
Once the rule is active, the trigger is the HR system, not an email. HR adds the employee, Zluri detects the event, the rule fires, and the playbook creates the AD account, the M365 account, and assigns the license — all before anyone in IT sees a notification. The notification they do receive is a confirmation that it's done.
Handling Offboarding in the Same Framework
Offboarding follows the same architecture in reverse. When HR marks an employee as terminated, Zluri detects the status change and triggers an Offboarding Playbook: the AD account is disabled, the M365 account is deactivated, the license is reclaimed, and the user is removed from groups.
The gap that manual offboarding and PowerShell scripts consistently miss is non-Microsoft applications. Disabling the AD account and revoking the M365 license closes the Microsoft surface. It doesn't touch Slack, Salesforce, Notion, or any other SaaS tool the user had access to independently. Zluri's Discovery Engine maps every application the departing user had access to — including tools acquired outside IT's formal provisioning process — and triggers the appropriate deprovisioning action per app as part of the same offboarding workflow.
A Note on Hybrid Environments
Several comments in this thread asked about hybrid environments specifically, and the answer to "does this work for both on-prem AD and O365" is yes — but it requires the Directory Agent for the on-prem side. The Entra Lifecycle Workflows option noted in the thread is cloud-only. Power Automate's M365 flows are effectively cloud-only for the provisioning layer. Zluri's LDAP Agent handles the on-prem AD write operations, so the same playbook creates both the on-prem account and the M365 account in a single automated run.
Frequently Asked Questions
How do you automate Office 365 user account creation without manual email requests?
The most reliable approach is connecting your HR system directly to your provisioning platform so account creation triggers automatically when a new hire is added, rather than waiting for an email notification. Zluri connects to HRMS platforms like BambooHR, Workday, and HiBob and triggers Onboarding Playbooks that create the M365 account, assign the license, and configure group memberships without any manual IT step.
Does Power Automate work for automating Active Directory onboarding in a hybrid environment?
Power Automate handles M365 provisioning well for cloud-only environments. For hybrid setups that require writing to on-premises Active Directory, Power Automate's native M365 flows don't reach the on-prem layer directly — you typically need a PowerShell script or an agent-based connector to handle the AD write. Zluri's Directory Agent bridges the hybrid gap by providing an outbound-only connection to on-prem AD that runs within the same provisioning playbook as the M365 actions.
What happens to Office 365 licenses when an employee is offboarded?
If offboarding is handled manually or through a script that only disables the account, the license often stays assigned to the inactive account — continuing to consume a paid seat. An automated offboarding playbook triggered by an HR termination event can include a license reclaim action that removes the M365 license as part of the same workflow, freeing the seat immediately rather than waiting for a manual audit.
How do you automate onboarding for both Active Directory and non-Microsoft SaaS apps?
The approach is a single HRMS-triggered playbook that handles both. The playbook includes actions for AD account creation, M365 license assignment, and API-based provisioning for each additional SaaS application the user needs on day one. Zluri connects to over 300 applications natively, so the same onboarding event that creates the AD and M365 accounts can also provision Slack, Salesforce, or any other app in the stack without separate manual steps per tool.
Automate Your Full M365 and AD Provisioning Sequence
If your current onboarding process still starts with an email to IT, see how Zluri connects to your HR system and automates the full M365 and AD provisioning sequence — including the hybrid AD setup and the downstream SaaS apps that need to be provisioned on day one alongside the Microsoft stack.












