Entra ID enumeration from one user account
Brief
An ordinary member of a Microsoft Entra tenant can read almost the whole directory by default: users, groups, applications, service principals, devices and role memberships. The first hour reads that directory and marks the places where reading turns into a path, without taking one.
On this page
- Situation
- One ordinary Entra ID user, a password and whatever MFA method the client enrolled for it, and a scope letter that names the tenant. The account has no Azure subscription and needs none. Everything here is a read through Microsoft Graph, and nothing registers an application or a device, consents to anything, invites anyone, or adds a credential to an object the user happens to own. We test only the tenant the letter names.
- Goal
- A directory map for that tenant: counts, privileged groups and their members, applications with high permissions and who owns them, device posture, and the objects this user owns.
- Outputs
- Representative examples on placeholder hosts, trimmed to the lines that matter. Not captured from a public fixture yet.
Check first
- The tenant id behind the domain in the scope letter, from the public OpenID configuration, before the first sign-in.
- What the sign-in demanded: MFA, a compliant device, a trusted location. That is the only view of Conditional Access this user gets.
- Whether members can read other users, guests are restricted and users can register applications; the client reads the settings, we see their effect.
- Which groups and applications this user owns, because ownership is where enumeration turns into escalation.
- Whether Microsoft Graph activity logs are on. Without them nothing on this page is recorded.
Steps
Azure
How do I confirm the tenant and sign in without an Azure subscription?
curl -s https://login.microsoftonline.com/corp.example.com/v2.0/.well-known/openid-configuration \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["issuer"])'
az login --tenant corp.example.com --allow-no-subscriptions
az ad signed-in-user show --query '{upn:userPrincipalName,id:id,type:userType}'
az rest --method get --url 'https://graph.microsoft.com/v1.0/organization' \
--query 'value[].{name:displayName,domains:verifiedDomains[].name}'
Expected output
$ curl -s https://login.microsoftonline.com/corp.example.com/v2.0/.well-known/openid-configuration | python3 ...
https://login.microsoftonline.com/<tenant-id>/v2.0 # <- must match the tenant id in the scope letter
$ az ad signed-in-user show --query '{upn:userPrincipalName,id:id,type:userType}'
{
"id": "<object-id>",
"type": "Member",
"upn": "tester@corp.example.com"
}
The OpenID configuration is public, so the tenant id is checked against the letter before any password is typed. --allow-no-subscriptions is needed because the account owns no Azure resources. The prompts are the first finding: an MFA prompt, a AADSTS53000 refusal for a non-compliant device or a AADSTS53003 block from our address each describe a policy this user cannot read.
Negative result. AADSTS53003 from outside the client's network means Conditional Access blocks this user where an attacker would stand, and the rest of the page runs from a position the letter allows.
Fix. A Conditional Access policy that blocks non-administrators from the Windows Azure Service Management API stops az login for ordinary users, which Microsoft recommends over the admin portal switch; Graph stays reachable with other clients, so it is friction, not a boundary.
How do I enumerate users, groups and role members with Graph?
az rest --method get --url 'https://graph.microsoft.com/v1.0/users/$count' --headers ConsistencyLevel=eventual
az ad user list --query "[?contains(userPrincipalName,'svc') || contains(userPrincipalName,'adm')].[userPrincipalName,accountEnabled]" -o tsv
az ad group list --query "[?contains(displayName,'Admin')].[displayName,id]" -o tsv
az ad group member list --group "Helpdesk Admins" --query '[].userPrincipalName' -o tsv
az rest --method get --url 'https://graph.microsoft.com/v1.0/directoryRoles?$expand=members' \
--query "value[].{role:displayName,members:members[].userPrincipalName}"
az ad signed-in-user list-owned-objects --type group --query '[].displayName' -o tsv
Expected output
$ az rest --method get --url 'https://graph.microsoft.com/v1.0/users/$count' --headers ConsistencyLevel=eventual
1842
$ az ad group member list --group "Helpdesk Admins" --query '[].userPrincipalName' -o tsv
helpdesk-1@corp.example.com
svc-ticketing@corp.example.com # <- a service account inside a privileged group
$ az ad signed-in-user list-owned-objects --type group --query '[].displayName' -o tsv
Finance Shared Mailbox Users
Members list every user and group, read non-hidden membership and every administrative role with its members by default. We note the tenant's size, the naming pattern for admin and service accounts, which groups are role-assignable and which this user owns, since an owner manages membership. An owned group inside a role or a Conditional Access exclusion is a path; we mark it and do not walk it.
Negative result. A 403 Authorization_RequestDenied on /users means allowedToReadOtherUsers is false, which Microsoft calls a special-circumstances setting, or the account is a restricted guest. Either is the control working.
Fix. Short of that flag, which Microsoft warns can break Teams, the fix is in what the directory reveals: no service accounts in privileged groups, roles through Privileged Identity Management with no standing membership, group owners reviewed, guests on the most restrictive setting.
Which applications can this user see, and which does it own?
az ad app list --all --query '[].[displayName,appId]' -o tsv | wc -l
az ad sp list --all --filter "servicePrincipalType eq 'Application'" --query '[].[displayName,appId]' -o tsv | wc -l
az ad signed-in-user list-owned-objects --type application --query '[].[displayName,appId]' -o tsv
az rest --method get --url "https://graph.microsoft.com/v1.0/servicePrincipals/<sp-object-id>/appRoleAssignments" \
--query 'value[].{resource:resourceDisplayName,roleId:appRoleId}'
az ad sp show --id 00000003-0000-0000-c000-000000000000 --query "appRoles[?id=='<app-role-id>'].value" -o tsv
az ad app owner list --id <app-id> --query '[].userPrincipalName' -o tsv
Expected output
$ az ad signed-in-user list-owned-objects --type application --query '[].[displayName,appId]' -o tsv
hr-sync-dev <app-id> # <- an app registration this user owns
$ az rest --method get --url ".../servicePrincipals/<sp-object-id>/appRoleAssignments" --query ...
[
{
"resource": "Microsoft Graph",
"roleId": "<app-role-id>"
}
]
$ az ad sp show --id 00000003-0000-0000-c000-000000000000 --query "appRoles[?id=='<app-role-id>'].value" -o tsv
Directory.ReadWrite.All # <- owning hr-sync-dev means being able to add a credential to this
Members list every application and the permissions granted to it; the CLI returns a hundred unless --all is given. Application permissions are app role assignments whose ids resolve against the Microsoft Graph service principal, the 00000003 id above. The path is ownership: an owner of an app registration or enterprise application can add a credential and act with its permissions. We stop at the owner and the permission; the Entra agent role research is a recent case.
Negative result. No owned applications, and no service principal with application permissions above read whose owners include a non-administrator.
Fix. Set "Users can register applications" to No and grant it back through the Application Developer role. Set user consent to "Do not allow", or to verified publishers for low-impact permissions. No ordinary user should own an application that holds application permissions.
How do I read Conditional Access when the user cannot read the policies?
az rest --method get --url 'https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies'
az rest --method get --url 'https://graph.microsoft.com/v1.0/policies/authorizationPolicy' --query 'defaultUserRolePermissions'
Expected output
$ az rest --method get --url 'https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies'
Forbidden({"error":{"code":"Authorization_RequestDenied","message":"Insufficient privileges to complete the operation."}}) # <- expected: both reads need Policy.Read.All
Both calls need Policy.Read.All, which an ordinary user's token lacks, so the refusal is normal. Conditional Access is still readable, just not as a document: every sign-in returns its decision for that app, device and location. We sign in from our address and the client network, from a managed and an unmanaged device where the letter allows, record what was prompted, blocked or let through, then ask the client for the policy export.
Negative result. Inverted here: a 200 with the policy list means the user holds a reader role and the client app was granted Policy.Read.All, and both go in the report.
Fix. Policies covering all users and all cloud apps with MFA, with exclusions held in groups only administrators own; an exclusion group owned by an ordinary user is a bypass. Microsoft says the admin portal restriction is not a security control.
Can this user enumerate every device in the tenant?
az rest --method get --url 'https://graph.microsoft.com/v1.0/devices/$count' --headers ConsistencyLevel=eventual
az rest --method get --url 'https://graph.microsoft.com/v1.0/devices?$select=displayName,operatingSystem,trustType,isCompliant,approximateLastSignInDateTime&$top=2' \
--query 'value'
az rest --method get --url 'https://graph.microsoft.com/v1.0/me/ownedDevices?$select=displayName,trustType' --query 'value'
Expected output
$ az rest --method get --url 'https://graph.microsoft.com/v1.0/devices/$count' --headers ConsistencyLevel=eventual
2217
$ az rest --method get --url 'https://graph.microsoft.com/v1.0/devices?$select=...&$top=2' --query 'value'
[
{
"approximateLastSignInDateTime": "2026-10-24T07:12:41Z",
"displayName": "LT-4471",
"isCompliant": true,
"operatingSystem": "Windows",
"trustType": "AzureAd"
},
{
"approximateLastSignInDateTime": "2026-10-26T18:03:09Z",
"displayName": "iPhone",
"isCompliant": null,
"operatingSystem": "iOS",
"trustType": "Workplace" # <- a registered personal device with no compliance state
}
]
Members enumerate every device and all of its properties. trustType gives the join type: AzureAd joined, Workplace registered, ServerAd hybrid joined. We count registered devices with no compliance state and stale devices still enabled; the registration settings themselves are readable only by device administrators. Registering a device is persistence, not something this page does; the token replay research shows what rogue registrations are for.
Negative result. Every Workplace device carries a compliance state, stale devices are disabled, and registration requires MFA through the Conditional Access user action.
Fix. Require MFA to register or join through the Conditional Access "Register or join devices" user action, set a device limit per user, disable devices with no sign-in for ninety days, and require a compliant device for anything that matters.
The defender sees
The sign-in log records this user signing in to the Azure CLI from our address with the Conditional Access result. The reads appear only in Microsoft Graph activity logs, which need an Entra ID P1 or P2 licence and a diagnostic setting, and record RequestUri, UserId, AppId and IPAddress per call. Where they are on, one user touching six collections in fifteen minutes is worth a rule:
MicrosoftGraphActivityLogs
| where TimeGenerated > ago(1d) and RequestMethod == "GET"
| extend path = tolower(tostring(parse_url(RequestUri).Path))
| where path has_any ("/users", "/groups", "/applications", "/serviceprincipals", "/directoryroles", "/devices")
| summarize Requests = count(), Collections = dcount(path) by UserId, AppId, IPAddress, bin(TimeGenerated, 15m)
| where Collections >= 4
The audit log shows nothing, because nothing changed. If the client saw only the sign-in, the diagnostic setting is the first fix.
Done when
Each of the five reads is recorded with what the tenant returned or refused, every owned object is listed with what owning it would allow, and the prompts the sign-in demanded are written down as the only view of Conditional Access this user gets.
Not covered
Using an owned application or group, device registration, password or token attacks and tenants where the user is a guest; the outputs shown are representative examples on a placeholder tenant, not captured runs.