Skip to main content
Version: 0.10

Azure users (WIP)

Pulls user identities from Entra ID via Microsoft Graph, then enriches each one with its admin roles, group and team memberships, MFA registration, password hygiene, licences and sign-in activity, and says which paid licences sit on disabled or idle accounts.

Type nameazure_users
CreatesUsers
Runs onA sensor with outbound reach to graph.microsoft.com
Presence flagazure_ad_exits
Field prefixazure_ad_

What it contributes​

  • Identity — object ID, display name, given name, UPN, mail, user type
  • Contact — mobile phone, business phones, office location, preferred language
  • Organisation — job title, department, company name
  • Account state — account enabled, created datetime
  • Admin roles — the directory roles the user holds, directly or through a group, including roles scoped to an administrative unit (azure_ad_roles_*, shown as Admin Roles); whether the user is an admin, and whether any role is one Microsoft labels privileged
  • Memberships — groups (azure_ad_groups_*) and teams, each with IDs and display names
  • MFA — registered, capable, the methods registered, the preferred second factor, passwordless capable, self-service password reset registered
  • Password and identity — password last changed, password never expires, password policies, sessions valid from (the last revocation), usage location, every email alias, and the security identifier (SID)
  • Licences — licence IDs, SKU IDs and SKU part numbers; the paid licences alone; a License Status and a License Reclaimable flag (see Licence use)
  • Hybrid sync — on-premises SAM account name, sync enabled, last sync datetime
  • Sign-in activity — last sign-in, last non-interactive sign-in, last successful sign-in
  • Licence use signals — read by License Optimization (see License Optimization):
    • last use of each Microsoft 365 service, from the usage reports (Service Activity);
    • the newest sign-in to each app (App Sign-in Activity);
    • the newest admin change from the audit log (Last Admin Action);
    • since when each admin role is held, when each licence was assigned, and since when a disabled account is off (Disabled Since).

A part the run could not read — a permission or licence missing — is left out rather than written as empty, so an earlier scan's values stay.

It writes the shared user fields user_full_name, user_email, user_title, user_organization, user_department and updated_at, and adds the mobile and business phone numbers to the shared phone_number, keeping numbers other sources wrote. The newest of the three sign-in times is the sighting it reports for last_seen.

Licence use​

Each user gets one License Status:

StatusMeaning
ActiveHolds a paid licence and signed in within the idle threshold
IdleHolds a paid licence and has not signed in within the threshold — or never has, and was created before it
DisabledHolds a paid licence on an account that cannot sign in
New, not signed in yetHolds a paid licence, never signed in, created within the threshold
Free licenses onlyHolds only free or self-service licences
UnlicensedHolds no licence

License Reclaimable is set for Idle and Disabled. A licence counts as free when its subscription has 10,000 seats or more — Microsoft's self-service and viral offers, or by its name (FLOW_FREE, POWER_BI_STANDARD and others, and any name ending in _FREE or _VIRAL). The last sign-in used here is the newest of the interactive, non-interactive and successful sign-in times.

The threshold is the scan template's License idle after (days), 90 by default.

The integration also installs an Entra ID Security and Licenses dashboard: accounts without MFA, admins without MFA, privileged admins, passwords that never expire or are over a year old, and reclaimable licences by product.

Sign-in activity plus licences finds waste and risk at once

An account with a licence assigned and no successful sign-in for months is either a cost to reclaim or a dormant credential to disable. Both readings argue for the same action, and this is the only source that gives you the pair.

License Optimization​

The License Optimization module reads these users to find licences and admin roles that could go, under its Microsoft 365 tab:

  • disabled accounts still licensed, after a grace period;
  • accounts that never signed in;
  • idle guests and inactive users;
  • add-on licences nobody uses, judged by each licence's usage signals (Power BI by its app sign-ins, Exchange Online by mail activity, and so on — editable per licence);
  • admin roles whose holder did nothing an admin does;
  • bought seats nobody is assigned.

Microsoft keeps the sign-in and audit logs for about 30 days. Each scan merges what it sees into what the user already holds, so the history grows with every scan: an admin role is judged against a 90-day threshold once 90 days of history are collected, and left unjudged until then.

Usage reports hide user names by default

Microsoft 365 conceals user names in its usage reports unless a tenant administrator turns that off: Microsoft 365 admin center → Settings → Org settings → Services → Reports → clear Display concealed user, group, and site names in all reports. While names are concealed, service use cannot be tied to users: the module says so and leaves the add-ons judged by it alone.

Requirements​

The integration is outbound-only: it is a scheduled Graph client, so nothing is installed in the tenant, nothing runs on the users' machines, and nothing has to reach into the deployment.

Network access​

FromToProtocolPort
The sensor running the integrationlogin.microsoftonline.com — the token endpointHTTPS over TCP443
The sensor running the integrationgraph.microsoft.com — the directory itselfHTTPS over TCP443

Two hosts, because authentication and data live in different services: the run takes a client-credentials token from the first, then pages the directory from the second. If the sensor reaches the internet through a proxy, point Proxy settings at it rather than opening direct egress.

Access in Entra ID​

NeedWhy
An account that can register applicationsThe credential is an app registration with a client secret
An account that can grant tenant-wide admin consentEvery permission is an application permission, which are inert until consented — see Permissions in Entra ID
Entra ID P1 or above, for sign-in activity and MFA registrationBoth are licensed; without P1 the run still succeeds and those fields are left out

In this deployment​

NeedWhy
A registered, healthy sensorThe integration runs on a sensor, on the platform's schedule — see Sensors

There are no special host requirements beyond a sensor that is checking in. Note that the per-user calls make this a long-running integration on a large tenant, so prefer a sensor that is reliably up over the smallest one available.

Configuration​

FieldRequiredNotes
NameYesLabel for this instance
Application (client) IDYesApp registration client ID
Directory (tenant) IDYesEntra tenant ID
Client SecretNoRequired in practice for client-credentials auth. Write-only: once saved, the console shows a locked box with Replace and Remove, and never displays it again
Proxy settingsNohttp://host:port
SensorYesSensor that will run the integration
Ignore SSLYesNot used: the sensor always validates Microsoft's certificates

The scan template adds License idle after (days): how long a licensed account may go without signing in before its licence counts as reclaimable. Default 90, from 1 to 3650.

Permissions in Entra ID​

Register an application and grant admin consent for these application permissions on Microsoft Graph:

PermissionNeeded for
User.Read.AllThe user list and per-user detail
Directory.Read.AllmemberOf, for groups; the tenant's licence subscriptions (Organization.Read.All also covers these)
AuditLog.Read.AllsignInActivity, the MFA registration report, the sign-in log and the directory audit log
Reports.Read.AllThe Microsoft 365 usage reports: last use of each service
RoleManagement.Read.DirectoryAdmin roles, from the tenant's role assignments
UserAuthenticationMethod.Read.AllOptional: per-user authentication methods, used for MFA when the report is unavailable

The run authenticates with client credentials and reads these once for the whole tenant:

  • the MFA registration report (/reports/authenticationMethods/userRegistrationDetails);
  • the role assignments (/roleManagement/directory/roleAssignments);
  • the licence subscriptions (/subscribedSkus), with their bought and assigned seats;
  • the Microsoft 365 usage reports (getOffice365ActiveUserDetail, getM365AppUserDetail);
  • the last 30 days of successful sign-ins (/auditLogs/signIns) and of the directory audit log (/auditLogs/directoryAudits), read page by page and never held whole.

It then pages /v1.0/users and per user reads memberOf, joinedTeams, licenseDetails, authentication/methods, appRoleAssignments, registeredDevices, ownedDevices and a $select projection that includes signInActivity, the assigned service plans and the password fields. A per-user read Graph refuses comes back empty rather than failing the run.

Test connection reads one user from /v1.0/users, which proves User.Read.All, then names each of the tenant-wide reads above, and the memberOf and licenseDetails reads, that the credential cannot make. It does not check the other per-user reads.

TODO

Confirm the application permissions for the per-user joinedTeams, appRoleAssignments, registeredDevices and ownedDevices reads. The sensor does not name a permission for them, and without one they return empty lists: teams are then left empty, and the other three are collected but not shown.

Sign-in activity needs AuditLog.Read.All and a P1 licence

Graph only returns signInActivity for tenants with Entra ID P1 or above, and only when the audit-log permission is consented. Without either, the sign-in fields come back empty while the rest of the run succeeds — a silent partial result rather than a failure.

Per-user calls mean a long first run

Groups, teams, licences, authentication methods and the other per-user reads are fetched one user at a time, and the run pauses 30 seconds between pages of the user list. On a large tenant every run takes a while, and is sensitive to Graph throttling; throttled and failed requests are retried.

Matching​

Each user is matched to an existing user by the first rule that finds one: Entra object ID, then mail, then UPN, then Entra display name, then mail against the shared user_email, then display name against the shared user_full_name. A user that matches nothing creates a new user, subject to the template's On New Asset Discovered action.

See also​