Library / Microsoft 365

M365-005 · Script

MFA Enrollment and Status

Reports which Microsoft 365 users have registered for multifactor authentication (MFA), and how MFA is enforced.

Version 1.0.0Language PowerShellUpdated November 2026Report only, changes nothing

What it does

Read-only. Saves a dated CSV in the Reports folder with each enabled user's MFA registration, registered methods, default method, passwordless and self-service password reset readiness, and admin status. Also reports how MFA is enforced in the tenant: whether security defaults are on, and which enabled Conditional Access policies require MFA. Flags: Admin without MFA, No MFA registered.

Requirements

Microsoft Graph PowerShell SDK, installed by you from the PowerShell Gallery (not included). Graph application permissions: AuditLog.Read.All, UserAuthenticationMethod.Read.All, User.Read.All, Policy.Read.All. Registration details need Microsoft Entra ID P1 or higher. Windows PowerShell 5.1 or PowerShell 7.

How to run it

  • Run from: an admin workstation or scheduled task with the Microsoft modules installed and app sign-in configured
  • This is an admin script for your Microsoft 365 tenant, not a per-device endpoint script
  • User interaction: none with app-only sign-in
  • Schedule: run on demand, or weekly for reports

Settings

NameWhat it doesOptionsDefault
AdminsOnlyOnly report accounts with admin roles.False
IncludeGuestsInclude guest accounts (excluded by default).False
AlertOnWhen to exit 1: AdminsWithoutMfa (default), AnyWithoutMfa, or Never.AdminsWithoutMfa, AnyWithoutMfa, NeverAdminsWithoutMfa
TenantIdDirectory (tenant) ID, for unattended app-only sign-in.
ClientIdApplication (client) ID of your app registration.
CertificateThumbprintThumbprint of the certificate uploaded to the app registration.
UseExistingSessionUse a Microsoft Graph session you already opened with Connect-MgGraph.False

Exit codes

  • 0 = Completed, no findings for the -AlertOn setting
  • 1 = Users without MFA found (per -AlertOn)
  • 2 = Script error (see log)

Testing steps

  1. Run it on one test tenant or small OU and check the output and log.
  2. Check the exit code: 0 = OK, 1 = needs attention, 2 = error (see log), 9 = this copy is past its Valid until date.
  3. Roll out to a small group next, then everyone.

Rollback steps

Report only. It saves a CSV and changes nothing else.

Version and change log

VersionDateChanges
1.0.0November 2026First release.