1. Resources
  2. Identity Threats
  3. Microsoft Entra ID

Microsoft Entra ID Tenant Reconnaissance

Also known as: Entra ID enumeration, Azure AD reconnaissance, Tenant enumeration, Microsoft Graph enumeration, User enumeration in Entra ID

Anyone can read a tenant's ID, domains and sign-in configuration without an account, and any signed-in user can read most users, groups, applications and role assignments through Microsoft Graph.

Platform
Microsoft Entra ID
Tactic
Discovery
Impact
Low
Last updated
Attack difficulty
Low
Detection difficulty
High
Privileges required: No account
None for tenant and domain discovery. Any member account, guest account or service principal with directory read access for object enumeration through Microsoft Graph.
What the attacker gains
The tenant ID, domains and federation setup, a list of valid user names, and a map of users, groups, applications and privileged role holders.
Threat groups
APT29Storm-0501ShinyHuntersGroups that MITRE ATT&CK records using T1087.004, T1069.003, T1526.

How it works

Reconnaissance against Microsoft Entra ID has two stages. The first needs no account and uses public endpoints of the Microsoft identity platform. The second needs any signed-in identity and uses Microsoft Graph.

Unauthenticated: domain, tenant and authority

Every tenant publishes an OpenID Connect configuration document for each of its verified domains. The document lists the issuer, the authorization and token endpoints and the location of the signing keys, and the issuer contains the tenant ID. Reading it needs no sign-in and creates no sign-in record.

Other public endpoints, built for the sign-in page's own use, answer questions an attacker cares about:

  • Is this domain managed by Entra ID or federated to another identity provider, and which one?
  • Does this user name exist? The sign-in page has to decide what to show next for a given name, and the endpoints behind it can be queried directly.

A verified domain shows that a directory claims that suffix. It doesn't show that a particular sign-in name exists, and a guest who signs in to this tenant authenticates in a different home tenant.

Authenticated: directory objects through Microsoft Graph

Once signed in, an identity reads the directory through Microsoft Graph. In a default configuration a member user can read most of it. The collections that matter:

Request What it returns Why an attacker wants it
GET /domains Domains with isVerified and authenticationType Which suffixes are managed and which are federated
GET /users id, userPrincipalName, userType and other selected properties Targets for spraying and phishing; guests and synced accounts
GET /groups id, displayName, group type Groups that carry roles, application access or policy exclusions
GET /groups/{id}/members Direct members of a group Who benefits from the group's access
GET /roleManagement/directory/roleAssignments principalId, roleDefinitionId, directoryScopeId Who holds Global Administrator and other privileged roles, and at what scope
GET /servicePrincipals, GET /applications Applications, their owners and granted permissions Workload identities with powerful Graph permissions

The attacker joins these into a graph: user is member of group, group holds role at scope, user owns application, service principal holds a Graph application permission. Each edge is one fact from one object; the path is what matters. A few rules keep the graph honest:

  • Join on object IDs, not display names. Two groups can share a name, and a renamed user keeps its ID.
  • An app registration and its service principal share an application ID but have different object IDs. Role assignments and permission grants point at the service principal.
  • A directory role says nothing about Azure subscriptions. Azure RBAC is a separate system, covered on the Azure reconnaissance page.
  • Eligible is not active. A Privileged Identity Management eligibility becomes a role only when it is activated.
  • Graph returns collections in pages. A listing that stops at the first page misses most of a large directory.

Prerequisites

  • For tenant and domain discovery: a domain name the organization uses. Nothing else.
  • For user name validation: a list of candidate names, usually built from the organization's email format.
  • For directory enumeration: any identity that can get a Microsoft Graph token. A member user has the widest default read access. A guest sees less, depending on the tenant's guest access setting. A service principal needs a directory read permission such as Directory.Read.All.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

The steps below are for an authorized assessment or a lab.

1. Find the tenant from a domain name

# The issuer and endpoint URLs in the response contain the tenant ID
curl -s https://login.microsoftonline.com/corp.example.com/v2.0/.well-known/openid-configuration

AADInternals wraps this and the other public lookups:

Import-Module AADInternals

# Tenant ID for a domain
Get-AADIntTenantID -Domain corp.example.com

# Sign-in information for the domain: managed or federated, federation endpoints
Get-AADIntLoginInformation -Domain corp.example.com

# One summary: verified domains and their type, DNS and mail records, SSO settings
Invoke-AADIntReconAsOutsider -Domain "corp.example.com" | Format-Table

2. Check which user names exist

# Default method: asks the sign-in page's own lookup, no sign-in attempt
Invoke-AADIntUserEnumerationAsOutsider -UserName "alice@corp.example.com"

# A list of candidates through the same lookup
Get-Content .\users.txt | Invoke-AADIntUserEnumerationAsOutsider

# Login method: an actual sign-in attempt per name, which the tenant logs
Get-Content .\users.txt | Invoke-AADIntUserEnumerationAsOutsider -Method Login

The valid names feed password spraying and device code phishing.

3. Enumerate the directory with an account

Azure CLI can call Microsoft Graph with the signed-in session:

az login --allow-no-subscriptions

# Domains and how each one authenticates
az rest --method get --url "https://graph.microsoft.com/v1.0/domains"

# Users, with the properties worth keeping
az rest --method get \
  --url "https://graph.microsoft.com/v1.0/users?\$select=id,userPrincipalName,userType,accountEnabled,onPremisesSyncEnabled"

# Every directory role assignment: principal, role and scope
az rest --method get \
  --url "https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments"

# Role definitions, to turn roleDefinitionId into a role name
az rest --method get \
  --url "https://graph.microsoft.com/v1.0/roleManagement/directory/roleDefinitions?\$select=id,displayName"

# Members of one group
az rest --method get \
  --url "https://graph.microsoft.com/v1.0/groups/00000000-0000-0000-0000-000000000000/members"

Each response carries the results in value. When @odata.nextLink is present, request that URL for the next page and repeat until it is absent.

4. Collect the whole directory

ROADrecon downloads the directory into a local database and serves a web interface over it:

# Sign in with a password, or with the device code flow when MFA is required
roadrecon auth -u alice@corp.example.com -p '<password>'
roadrecon auth --device-code

# Download users, groups, devices, roles, applications and service principals
roadrecon gather

# Start the local web interface over the collected database
roadrecon gui

AzureHound collects the same objects for BloodHound, which computes the paths:

./azurehound -u "alice@corp.example.com" -p "<password>" list --tenant "corp.example.com" -o output.json

AADInternals has a summary for an insider account, including directory synchronization status and the members of administrative roles:

Get-AADIntAccessTokenForAzureCoreManagement -SaveToCache
$results = Invoke-AADIntReconAsInsider
$results.roleInformation | Where Members -ne $null | select Name,Members

5. Pick the targets

From the collected data, list the holders of Global Administrator, Privileged Role Administrator, Application Administrator and the authentication and password administrator roles; the service principals with Graph permissions that can grant roles or permissions; the owners of those applications; synced accounts with cloud roles; and the accounts excluded from Conditional Access by group.

Impact

The direct result is information, which is why the impact is rated low. Its use is everything that follows: valid user names for spraying and phishing, the identity provider to imitate, the short list of accounts whose compromise gives the tenant, and the applications whose owner or credential is the easiest route to a privileged role. An attacker who has done this work makes few failed attempts and touches few accounts.

OPSEC and artifacts

  • Public metadata and the default name lookup leave no sign-in record. They are requests to Microsoft's public endpoints, not sign-ins to the tenant. The tenant has no log of them.
  • Sign-in based name checks are logged. The Login method produces a sign-in record per name: error 50034 for a name that doesn't exist and 50126 for a wrong password. One address producing many 50034 results is a recognizable pattern, so operators prefer the lookup that doesn't sign in.
  • Graph reads create no audit events. The audit log records changes. A full directory download by a signed-in user is invisible there.
  • Graph activity logs record every request, with the application ID, the user or service principal, the request URI and the response code, when the tenant exports them. Collection tools request every collection in minutes and page through it; operators slow down, select fewer properties and use a client that the account normally uses.
  • The token request is a sign-in. ROADrecon, AzureHound, Azure CLI and Azure PowerShell each sign in with a known client application ID. The record shows the client, address and user agent even when nothing shows the reads.
  • Portal exports are audited. Downloading the user, group or role assignment list from the admin center writes a bulk download event, such as Download users or Download role assignments. Operators use the API instead.

Detection

  • Bulk reads in Graph activity logs. The directory enumeration rules cover read bursts by a user or service principal, bursts of refused requests, and bulk downloads from the admin center.
  • Unknown user names from one address. Many sign-in failures with result 50034 from one IP address point to name validation by sign-in. The password spraying rules include it.
  • Microsoft's own detection. ID Protection raises the suspicious API traffic risk detection for abnormal Graph traffic by a user.
  • Unusual clients. A user who has never used Azure CLI or PowerShell obtaining Graph tokens with those clients.

Graph GET requests per application and collection, from the exported activity log:

MicrosoftGraphActivityLogs
| where RequestMethod == "GET"
| extend Path = tostring(parse_url(RequestUri).Path)
| extend Collection = extract(@"^/(?:v1\.0|beta)/(users|groups|domains|servicePrincipals|applications|roleManagement)(?:/|$)", 1, Path)
| where isnotempty(Collection)
| summarize Requests = dcount(RequestId)
    by AppId, UserId, ServicePrincipalId, Collection, ResponseStatusCode, bin(TimeGenerated, 1h)
| order by Requests desc

Read the result with care. Paging inflates request counts, a 200 can be an empty collection, a 403 shows an attempt and not disclosure, and requests sent inside a Graph batch don't appear as separate GETs. Entra ID keeps sign-in and audit data for 7 days on the free tier and 30 days with P1 or P2, so export what you need to a workspace before an investigation needs it.

Mitigation

Public metadata can't be hidden and member users need to read the directory to work, so mitigation limits who can read, how much, and how useful the answer is.

  • Restrict guest access. Set guest user access to the most restrictive level so that guests can't enumerate users and groups, and limit who can invite guests.
  • Restrict access to the admin center for non-administrators. This doesn't stop Graph calls, but removes the easy export.
  • Require MFA and a compliant device for Microsoft Graph command-line and Azure management clients with Conditional Access, and block clients the organization doesn't use.
  • Reduce what the map shows. Few permanent privileged role assignments, no synced accounts in cloud roles, no stale service principals with powerful permissions. Make privileged roles eligible through Privileged Identity Management.
  • Review application permissions. A service principal with Directory.Read.All can read everything a user can and more. Grant the narrowest permission that works.
  • Export Microsoft Graph activity logs and sign-in logs to a workspace, including non-interactive, service principal and managed identity sign-ins. Without them, enumeration by a signed-in identity can't be reconstructed.
  • Make valid user names less useful. Phishing-resistant MFA and smart lockout mean a confirmed name is not a step toward a session.

Detection rules for this attack

Log events to collect

FAQ

Can someone enumerate an Entra ID tenant without an account?

Partly. The OpenID Connect metadata for any domain is public and returns the tenant ID. Public endpoints also reveal whether a domain is managed or federated, and some respond differently for user names that exist. Listing groups, applications and role assignments needs a signed-in identity.

Can a normal user list all Global Administrators?

Yes, in a default configuration. Directory role assignments are readable by member users through Microsoft Graph, so any compromised account can list who holds Global Administrator and other privileged roles and pick targets from that list.

Are Microsoft Graph read requests logged?

Not in the audit log: reads don't change the directory, so they create no audit event. They are recorded in Microsoft Graph activity logs, which exist only if the tenant has configured a diagnostic setting to export them. Without that export, directory enumeration by a signed-in identity leaves the sign-in record and nothing else.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.