Automation

Microsoft Entra ID & M365 Access Governance - RBAC, MFA & SharePoint

Microsoft 365 Systems & Identity Automation Engineer

Business summary
Engineering, Construction & Enterprise IT Governance • Microsoft Entra ID (Azure AD) security audit, RBAC permissions, MFA enforcement & SharePoint templates
  • Audited all M365 accounts, MFA states, and SharePoint permissions via Microsoft Graph API & Python
  • Closed 42 stale former-staff accounts, enforced 100% MFA, and reclaimed 28% in unused M365 licence spend
  • Automated SharePoint project site provisioning with locked 8-folder templates, RBAC groups, and daily cloud backups

What I built

Executed an end-to-end Microsoft 365 and Entra ID (Azure AD) security, access, and permissions audit for a multi-site engineering and project delivery organization. Used Microsoft Graph API and Python/PowerShell automation to inventory all active/stale user accounts, MFA enforcement states, external guest sharing links, and SharePoint/OneDrive permission trees. Built automated Joiner-Mover-Leaver (JML) workflows in Power Automate that provision role-based Entra ID security groups, deploy standardized SharePoint project site templates with locked folder hierarchies and automated backups, and revoke departed staff access while reclaiming 28% in unused licences.

Tech stack

Microsoft Entra IDMicrosoft 365 AdminSharePoint PermissionsPower AutomateMicrosoft Graph APIEntra IDAzure ADMicrosoft 365RBACMFAConditional AccessSharePoint OnlineOneDrivePythonSecurity AuditAccess GovernanceJML Automation
Deep Dive Case Study

Microsoft Entra ID & M365 Security Audit, RBAC & SharePoint Governance

Identity and access auditing, Microsoft Entra ID (Azure AD) security group automation, standardized SharePoint project provisioning, and Joiner-Mover-Leaver (JML) workflows.


Snapshot

Role Microsoft 365 Systems & Identity Automation Engineer
Stack Microsoft Entra ID (Azure AD) · Microsoft Graph API · Power Automate · SharePoint Online · OneDrive · Python / PowerShell
Domain Multi-site engineering, construction consultancy, and operational IT governance
Primary Users CEO / Managing Director, Project Managers, Site Engineers, and External Subcontractors
Outcome Closed 40+ orphaned ex-employee/contractor access paths, reached 100% MFA compliance, reclaimed 28% in unused M365 licences, and standardized all new project folder trees

The Problem

As the company grew across multiple project sites and office locations, Microsoft 365 and cloud tools had been set up organically without central governance:

  • Orphaned access & licence sprawl: People who had left the business months earlier still had active Microsoft 365 accounts, third-party SaaS logins, and synced OneDrive folders.
  • Ad-hoc SharePoint permissions: Every project manager created their own folder structure in SharePoint and shared individual sub-folders via anonymous or guest links, making it impossible to see who had access to sensitive commercial tenders and site drawings.
  • Inconsistent MFA & conditional access: Legacy accounts bypassed Multi-Factor Authentication (MFA), creating a significant security risk for executive mailboxes and financial spreadsheets.

What I Built

1. Automated Access & Security Audit via Microsoft Graph API

Built a repeatable Python + Microsoft Graph API audit script and executive Power BI / Excel report for the CEO: -Queried /users, /groups, /auditLogs/signIns, and /sites/{id}/permissions across the entire tenant.

  • Produced a clear, traffic-light Access & Security Matrix identifying: accounts with no sign-in for 30+ days, users missing MFA enforcement, external guest accounts with broad SharePoint access, and broken permission inheritance across project libraries.

2. Entra ID Role-Based Access Control (RBAC) & MFA Hardening

Replaced individual user-by-user folder sharing with clean Entra ID Security Groups mapped to job roles (SG-Project-Managers, SG-Site-Engineers, SG-Commercial-Finance, SG-External-Consultants):

  • Configured Conditional Access Policies requiring phishing-resistant MFA for all internal staff and strict session timeouts for external guests.
  • Cleaned up stale accounts, converted departed staff mailboxes to shared mailboxes (preserving historical project correspondence without paying for active E3/Business Premium licences), and revoked all lingering OAuth tokens.

3. Automated SharePoint Project Template & Backup Pipeline

Built a Power Automate + SharePoint REST / Graph API provisioning engine:

  • Whenever a new project is approved, a Power Automate flow automatically provisions a standardized SharePoint Project Site with a locked 8-folder template (01-Commercial, 02-Drawings-Specs, 03-Site-Reports, 04-Subcontractors, 05-Health-Safety, etc.), applies the correct Entra ID security group permissions per folder, and registers the site in the automated cloud backup schedule.

What Did Not Work Initially (and How I Fixed It)

  • Breaking Legacy Links When Locking Down SharePoint: Immediately revoking all ad-hoc sharing links in one go risked breaking active spreadsheet links that site managers relied on mid-week. Fix: I ran a 2-week "shadow audit" first - using Graph API sign-in and file-access logs to see which links were actively used, migrating active collaborators into the new Entra ID security groups before expiring legacy guest links on a scheduled Friday cutover.
  • Graph API Throttling on Deep Folder Permission Scans: Scanning thousands of nested project drawing folders hit Microsoft Graph 429 Too Many Requests limits. Fix: Implemented delta queries ($delta) and exponential backoff honoring the Retry-After header in Python, reducing full-tenant audit time from 45 minutes to under 4 minutes.

Deliverables & Handover

  • Full CEO-ready Security & Access Audit Report with prioritized remediation roadmap
  • Entra ID RBAC security group architecture and MFA Conditional Access policies
  • Automated Joiner-Mover-Leaver (JML) Power Automate workflows (onboarding & 1-click offboarding)
  • Standardized SharePoint Project Template provisioner + automated backup verification
  • Clear administrator & project-manager handover documentation