🚨 CMMC Phase One started November 10! Here's everything you need to know →

How to Automate Compliance for NIST SP 800-171 REV.2 / CMMC 2.0 Level 2 - Control - IA.L2-3.5.6 Using Azure AD and Conditional Access to Disable Inactive Identifiers

Practical guide to automating IA.L2-3.5.6 (disable inactive identifiers) using Azure AD, Microsoft Graph, Conditional Access, and automation to meet NIST SP 800-171 / CMMC 2.0 Level 2 requirements.

•
April 16, 2026
•
4 min read

Share:

Schedule Your Free Compliance Consultation

Feeling overwhelmed by compliance requirements? Not sure where to start? Get expert guidance tailored to your specific needs in just 15 minutes.

Personalized Compliance Roadmap
Expert Answers to Your Questions
No Obligation, 100% Free

Limited spots available!

NIST SP 800-171 / CMMC 2.0 IA.L2-3.5.6 requires organizations to disable inactive identifiers to reduce the risk of unauthorized access from stale or orphaned accounts; this post explains a practical, automated approach using Azure AD (Microsoft Entra) and Conditional Access, with step-by-step options for small businesses to detect, quarantine, and disable inactive users while keeping auditors satisfied.

Why disabling inactive identifiers matters for Compliance Framework

Inactive accounts (former employees, contractors, orphaned service accounts) are a common attack vector — credentials can be re-used or compromised long after the owner stops using them. For Compliance Framework requirements such as IA.L2-3.5.6, you must show technical controls and repeatable processes to identify inactivity and remove access. Automation reduces human error, creates auditable logs, and provides the evidence auditors expect.

High-level implementation overview

The recommended pattern is: (1) collect sign-in telemetry, (2) run periodic detection to flag accounts with last-sign-in older than the organizational threshold, (3) add flagged accounts to a quarantine group, (4) apply Conditional Access or directly disable the accounts after an approval or notification window, and (5) log actions for audit. You can implement detection using Azure AD sign-in logs (Kusto queries in Log Analytics) or Microsoft Graph (signInActivity), and action via Microsoft Graph PowerShell, Logic Apps, or Azure Functions.

Prerequisites and platform considerations

Licensing and telemetry setup matter: Conditional Access requires Azure AD Premium P1; Access Reviews and entitlement governance require P2 if you want review-based removal workflows. To use sign-in logs in Log Analytics you must enable Diagnostic Settings to stream AuditLogs and SigninLogs to a Log Analytics workspace. Microsoft Graph's user signInActivity property is available in beta and requires AuditLog permissions. Also identify and exclude break-glass/emergency accounts and service principals — those must be handled by a separate documented process.

Detecting inactivity — practical queries and scripts

Two common detection approaches: (A) Kusto query against SigninLogs in Log Analytics: SigninLogs | summarize LastSignIn = max(TimeGenerated) by UserPrincipalName | where LastSignIn < ago(60d) — this returns users with no sign-ins in the last 60 days. (B) Microsoft Graph (beta) signInActivity: call GET /users?$select=id,displayName,userPrincipalName,signInActivity, then filter where signInActivity.lastSignInDateTime is older than your threshold or null. For automation, run these queries daily in an Azure Logic App, Azure Function, or runbook and capture the result set to feed into your action workflow.

Actioning disables with Conditional Access and Graph automation

There are two safe operational patterns: (1) use a quarantine Azure AD group and a Conditional Access policy that blocks sign-in for members of that group; (2) automatically disable the account directly via Microsoft Graph (set accountEnabled to false). Pattern (1) is reversible and auditable — create a group (e.g., quarantine-inactive-identifiers), have your automation add users to it, and a Conditional Access policy scoped to that group that blocks all cloud app sign-ins (put policy into "Report-only" first). Pattern (2) is cleaner but more disruptive and should include an automated notification and manager approval window. Example Graph PowerShell steps (simplified): Connect-MgGraph -Scopes "User.ReadWrite.All"; retrieve stale users; Update-MgUser -UserId <id> -AccountEnabled:$false. Always log who/what process performed the change with timestamps for audit.

Small business real-world scenario

Example: a 50-person small business sets policy: contractors disabled after 30 days inactivity, employees after 90 days. Implementation: stream SignInLogs to Log Analytics, run daily Kusto query to find inactive users, push matches to an Azure Logic App that (a) emails the manager with a 7-day notice, (b) if no response, adds the user to quarantine-inactive-identifiers. A Conditional Access policy blocks sign-in for that group. After 30 more days in quarantine, the Logic App calls Graph to set accountEnabled to false. All actions are logged to a storage account and an Azure Monitor workbook for auditors.

Compliance tips and best practices

Do these to strengthen your control and audit posture: maintain a written inactivity policy (define thresholds by identity class), keep an exceptions register for service and break-glass accounts, test automation in a non-production tenant or with a small pilot group, use role-based approvals (manager or identity owner), retain logs for the period required by Compliance Framework rules, and enforce separation of duties so the person who approves disablement is different from the automation operator. Use Conditional Access "Report-only" mode first to validate impact.

Risks of not implementing automated disables

Without automated disabling of inactive identifiers you increase exposure to credential reuse, lateral movement, and insider threat risk. For CMMC / NIST auditors, lacking a demonstrable, repeatable process can lead to findings or failed assessments, which can affect contract eligibility. Operational risks include unauthorized data access, regulatory penalties, and the operational cost of incident response and remediation after an account compromise.

In summary, implementing IA.L2-3.5.6 using Azure AD and Conditional Access is a practical, automatable control that reduces risk and satisfies Compliance Framework expectations: stream sign-in telemetry, detect inactivity with Kusto or Graph, quarantine via group + Conditional Access or directly disable accounts using Microsoft Graph, and ensure manager notifications, logging, and exception handling are in place — start small, test carefully, and document every step for auditors.

 

Quick & Simple

Discover Our Cybersecurity Compliance Solutions:

Whether you need to meet and maintain your compliance requirements, help your clients meet them, or verify supplier compliance we have the expertise and solution for you

 CMMC Level 1 Compliance App

CMMC Level 1 Compliance

Become compliant, provide compliance services, or verify partner compliance with CMMC Level 1 Basic Safeguarding of Covered Contractor Information Systems requirements.
 NIST SP 800-171 & CMMC Level 2 Compliance App

NIST SP 800-171 & CMMC Level 2 Compliance

Become compliant, provide compliance services, or verify partner compliance with NIST SP 800-171 and CMMC Level 2 requirements.
 HIPAA Compliance App

HIPAA Compliance

Become compliant, provide compliance services, or verify partner compliance with HIPAA security rule requirements.
 ISO 27001 Compliance App

ISO 27001 Compliance

Become compliant, provide compliance services, or verify partner compliance with ISO 27001 requirements.
 FAR 52.204-21 Compliance App

FAR 52.204-21 Compliance

Become compliant, provide compliance services, or verify partner compliance with FAR 52.204-21 Basic Safeguarding of Covered Contractor Information Systems requirements.
 
Hello! How can we help today? 😃

Chat with Lakeridge

We typically reply within minutes