Overview
This recipe creates a scheduled agent that runs monthly to rotate passwords for admin and service accounts across your connected M365 tenants. Every password reset requires technician approval, and new credentials are delivered securely.This is a scheduled agent — it runs on a cadence without processing a specific ticket. See Scheduled Agents for how this works.
How it works
- Agent runs monthly and identifies admin and service accounts across connected tenants
- For each account, the agent generates a secure password and requests Technician-in-the-Loop approval
- After approval, the password is reset and new credentials are delivered via a secure link
- A summary of all rotated accounts is logged
Setup
Create the agent
- Name: “M365 Password Rotation”
- Type: Agent
- Trigger: Scheduled
- Cadence: Monthly (e.g., first Monday at 5:00 AM)
Configure M365 integration permissions
Set these permission groups:
- Security — Read/Write with TIL enabled (for password resets)
- Directory Roles — Read Only (to identify admin accounts)
- User Management — Read Only (to search for service accounts)
Enable tools
- Generate Password — to create secure random passwords
- Generate Secure Link — to deliver credentials safely
- Send Teams Message or Send Internal Email — for delivery and summary
Variations
Separate schedules for admin vs service accounts
Split into two agents with different cadences:- Admin accounts — monthly rotation
- Service accounts — quarterly rotation (to reduce disruption to automated processes)
Create audit tickets
Add instructions to create a PSA ticket for each rotation cycle, logging which accounts were rotated, when, and by whom (the approving technician). This provides an audit trail for compliance reporting.Best practices
- Always require TIL approval — automated password resets without human oversight can lock out critical accounts
- Coordinate with your team on rotation schedules to avoid disruptions during business hours
- Maintain a list of break-glass accounts that should never have passwords rotated by automation
- Use the secure link tool for credential delivery — never include passwords in Teams messages or emails directly
- Document the rotation schedule in your internal wiki so all technicians know when to expect approval requests
