--- title: "Investigate M365 Security Posture: Secure Score, Risky Users, and Admin MFA" slug: "dex-wf-investigate-m365-security-posture" updated: 2026-11-30T16:15:52Z published: 2026-11-30T16:15:52Z canonical: "documentation.sysaid.com/dex-wf-investigate-m365-security-posture" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.sysaid.com/llms.txt > Use this file to discover all available pages before exploring further. # Investigate M365 Security Posture: Secure Score, Risky Users, and Admin MFA Audit your Microsoft 365 tenant's security posture by reviewing Secure Score, privileged role assignments, admin MFA coverage, and high-privilege app registrations, then prioritize remediation. **Complexity:** Intermediate. **Impact:** security-posture + privileged-access + mfa-coverage + app-governance + compliance-audit. ## Why use this workflow Microsoft 365 tenants drift toward insecurity over time: new admin accounts get added, apps accumulate privileged Graph permissions, Secure Score controls fall behind defaults, and MFA coverage gaps appear on the highest-value accounts. A quarterly (or incident-driven) posture review lets you catch these issues before an attacker does. This workflow walks through four high-leverage checks for a standard Microsoft 365 and Entra ID tenant: - **Secure Score:** Microsoft's aggregate rating of your identity, app, device, and data controls, compared against other tenants. - **Privileged role membership:** who currently holds Global Administrator and other Tier-0 directory roles. - **Admin MFA registration:** confirmation that every privileged account has a phishing-resistant authentication method registered (Microsoft Authenticator, FIDO2, or Windows Hello) rather than just SMS or password. - **App registration permissions:** third-party and internal applications that hold sensitive Microsoft Graph application roles, which represent a major supply-chain and lateral-movement risk. Run it when you onboard a new tenant, after a suspected incident, on a recurring schedule, or any time leadership asks for a security readout. ## Expected outcomes - A captured **current Secure Score** value, max score, and comparative benchmark. - A list of the **lowest-scoring Secure Score controls** ranked by remediation impact. - A **complete roster of Global Administrators** (and optionally all directory role holders) with account-enabled status. - A **per-admin MFA method inventory** that identifies any privileged account relying only on password or SMS. - An **app registration report** that flags applications with excessive Microsoft Graph application permissions. - A **prioritized remediation list** (Critical, High, Medium) that you can hand to leadership or execute directly. ## Risks and considerations - **Premium license dependency.** Risky user, risky sign-in, and some authentication-methods-report endpoints require Entra ID P1 or P2. On Entra ID Free tenants these calls return `403 Permission denied` with a message about premium licensing. Fall back to Secure Score, directory role enumeration, and per-user authentication methods. - **Read-only investigation.** This workflow only reads data. Do not remediate findings (disable accounts, remove role holders, revoke app consents) without a change ticket and stakeholder sign-off. Removing a legitimate service account can cause outages. - **App registration permissions are a high risk.** An app with `RoleManagement.ReadWrite.Directory` or broad `Directory.ReadWrite.All` roles is effectively a Global Administrator. Treat every high-privilege app as a privileged identity. - **Do not leak user data in reports.** The outputs contain UPNs, phone numbers, and device identifiers. Store them only in approved secure locations (for example, an encrypted SharePoint site with restricted access). - **Secure Score lag.** Control implementation status can take time to reflect recent changes. Re-check after remediation. ## Required permissions | Permission | Why it's needed | | --- | --- | | SecurityEvents.Read.All | Read Microsoft Secure Score and control recommendations. | | Directory.Read.All | Enumerate directory roles, role members, and user details. | | RoleManagement.Read.Directory | Resolve role definitions and assignments for privileged roles. | | UserAuthenticationMethod.Read.All | Inspect which MFA methods are registered on each administrator account. | | Application.Read.All | Inventory app registrations and their requested Graph permissions. | | AuditLog.Read.All | Query sign-in logs and directory audit events (requires Entra ID P1 for full data). | | IdentityRiskyUser.Read.All | List users flagged as risky by Entra ID Protection (requires Entra ID P2). | ## Ask Dex Paste the prompt into a Dex conversation. ### Prompt for IT admins ``` Investigate our M365 security posture: pull the current Secure Score and lowest-scoring controls, list all Global Administrators and other privileged role holders, verify every admin has strong MFA registered (not just password/SMS), and flag any app registrations holding more than {role_threshold} Microsoft Graph application roles. Produce a prioritized remediation list (Critical/High/Medium). ``` ## Manual steps (admin center) ### 1. Check Microsoft Secure Score 1. Sign in to the [Microsoft Defender portal](https://security.microsoft.com) as a Security Reader or Global Reader. 2. In the left navigation, go to **Exposure management** > **Secure score**. 3. Record the **current score**, **maximum achievable**, and **comparison to similar organizations**. 4. Open the **Recommended actions** tab and sort by *Points achievable* descending. Export the list (top right > **Export**). ### 2. Audit privileged role holders 1. Go to the [Microsoft Entra admin center](https://entra.microsoft.com). 2. Go to **Identity** > **Roles & admins** > **Roles & administrators**. 3. Select **Global Administrator**. Record every member's display name, UPN, and account-enabled status. 4. Repeat for **Privileged Role Administrator**, **Privileged Authentication Administrator**, **Exchange Administrator**, **SharePoint Administrator**, and **Application Administrator**. ### 3. Verify MFA on each admin 1. Still in the Entra admin center, go to **Identity** > **Users** > **All users**. 2. Select each admin that you identified in step 2, then select **Authentication methods**. 3. Confirm a phishing-resistant method is registered: Microsoft Authenticator (push), FIDO2 key, Windows Hello, or certificate-based authentication. Flag any admin with only *password* or *SMS*. ### 4. Review app registrations with high privileges 1. Go to **Identity** > **Applications** > **App registrations** > **All applications**. 2. Open each application and select **API permissions**. 3. Flag any app with *Application*-type permissions that contain `.ReadWrite.All`, `RoleManagement.*`, `Directory.ReadWrite.All`, or `Application.ReadWrite.All`. 4. Cross-check **Certificates & secrets** for expiring or long-lived credentials. ### 5. Build the remediation list Combine findings into a prioritized table (Critical, High, Medium) with owner, remediation, and target date. Share it with the security owner for sign-off before you take action. ## Microsoft Graph API ### 1. Retrieve latest Secure Score ``` GET https://graph.microsoft.com/v1.0/security/secureScores?$top=1 ``` Returns the most recent daily snapshot, including `currentScore`, `maxScore`, `averageComparativeScores`, and a `controlScores` array that lists every control and its implementation status. ### 2. List Global Administrators ``` GET /v1.0/directoryRoles?$filter=displayName eq 'Global Administrator'&$expand=members($select=id,displayName,userPrincipalName,accountEnabled) ``` Expands role members inline. Repeat for other privileged roles or enumerate all roles with `/v1.0/directoryRoles?$expand=members`. ### 3. Get authentication methods for a user ``` GET /v1.0/users/{upn}/authentication/methods ``` Returns an array of method objects. Inspect the `@odata.type` on each to identify the method class: - `#microsoft.graph.passwordAuthenticationMethod` - `#microsoft.graph.phoneAuthenticationMethod` (SMS or voice: weak) - `#microsoft.graph.microsoftAuthenticatorAuthenticationMethod` (strong) - `#microsoft.graph.fido2AuthenticationMethod` (strongest) - `#microsoft.graph.windowsHelloForBusinessAuthenticationMethod` (strong) ### 4. Enumerate app registrations and their requested permissions ``` GET /v1.0/applications?$select=id,displayName,appId,requiredResourceAccess ``` The `requiredResourceAccess` array lists each API (by `resourceAppId`, where `00000003-0000-0000-c000-000000000000` is Microsoft Graph) and the role and scope IDs requested. Resolve IDs to human-readable names with: ``` GET /v1.0/servicePrincipals?$filter=appId eq '00000003-0000-0000-c000-000000000000'&$select=appRoles,oauth2PermissionScopes ``` ### 5. (P1/P2 only) Risky users and risky sign-ins ``` GET /v1.0/identityProtection/riskyUsers?$filter=riskLevel ne 'low'&$top=50 GET /v1.0/auditLogs/signIns?$filter=riskLevelDuringSignIn eq 'high'&$top=50 ``` Returns `403 Permission denied - Tenant is not a B2C tenant and doesn't have premium license` on Entra ID Free. ### Example response shape (Secure Score) ``` {  "currentScore": 184,  "maxScore": 272,  "activeUserCount": 87,  "averageComparativeScores": [    { "basis": "AllTenants", "averageScore": 53.47 }  ],  "controlScores": [    { "controlName": "mdo_safedocuments", "score": 0, "on": "false" }  ] } ``` ## PowerShell Use the **Microsoft.Graph** PowerShell module. Install it once, then import the sub-modules that you use. ### 1. Install and connect ``` # One-time install (CurrentUser scope avoids admin elevation) Install-Module Microsoft.Graph -Scope CurrentUser # Connect with the scopes this workflow needs Connect-MgGraph -Scopes "SecurityEvents.Read.All",`                        "Directory.Read.All",`                        "RoleManagement.Read.Directory",`                        "UserAuthenticationMethod.Read.All",`                        "Application.Read.All" ``` ### 2. Pull Secure Score ``` $score = Get-MgSecuritySecureScore -Top 1 | Select-Object -First 1 "Current: $($score.CurrentScore) / $($score.MaxScore)" $score.ControlScores | Where-Object { $_.Score -eq 0 } |    Select-Object ControlName, ControlCategory, Description |    Format-Table -AutoSize ``` ### 3. List Global Administrators ``` $ga = Get-MgDirectoryRole -Filter "displayName eq 'Global Administrator'" Get-MgDirectoryRoleMember -DirectoryRoleId $ga.Id |    ForEach-Object { $_.AdditionalProperties } |    Select-Object displayName, userPrincipalName, accountEnabled ``` ### 4. Check MFA on each admin ``` $admins = Get-MgDirectoryRoleMember -DirectoryRoleId $ga.Id foreach ($m in $admins) {    $upn = $m.AdditionalProperties.userPrincipalName    $methods = Get-MgUserAuthenticationMethod -UserId $upn    $types = $methods.AdditionalProperties.'@odata.type' -replace '#microsoft.graph.',''    [pscustomobject]@{ User = $upn; Methods = ($types -join ',') } } ``` ### 5. Flag high-privilege apps ``` $graphId = '00000003-0000-0000-c000-000000000000' $threshold = 5   # set to your own threshold Get-MgApplication -All |    Where-Object {        ($_.RequiredResourceAccess | Where-Object { $_.ResourceAppId -eq $graphId }).ResourceAccess.Count -gt $threshold    } |    Select-Object DisplayName, AppId,        @{n='GraphRoles';e={ ($_.RequiredResourceAccess | Where-Object ResourceAppId -eq $graphId).ResourceAccess.Count }} ```