Chapter 1
Microsoft Entra ID: users, groups and access
Everything in Azure starts with an identity. Before you can give someone access to a VNet or a storage account, that person (or app) must exist in Microsoft Entra ID. This chapter covers users, groups, licenses, guests and self-service password reset.
Theory
Tenants and subscriptions
A tenant is one dedicated instance of Entra ID for one organisation. It has a default domain like contoso.onmicrosoft.com and can have extra custom domains (like contoso.com) after you prove ownership with a DNS TXT or MX record.
The relationship between tenants and subscriptions is a classic exam topic:
- A subscription trusts exactly one tenant for sign-in. All RBAC role assignments in the subscription point to identities in that tenant.
- A tenant can have many subscriptions.
- You can move a subscription to another tenant ("Change directory"). When you do, all RBAC role assignments are deleted, and managed identities and Key Vault access must be fixed afterwards.
Entra ID editions
Many exam questions are really asking "which license do you need?" Remember the features that need P1, because they come up most:
| Feature | Free | P1 | P2 |
|---|---|---|---|
| Users, groups, basic reports, B2B guests | โ | โ | โ |
| Security defaults (basic MFA for everyone) | โ | โ | โ |
| Dynamic groups | โ | โ | |
| Group-based licensing | โ | โ | |
| SSPR for users (and password writeback to on-prem AD) | โ | โ | |
| Conditional Access | โ | โ | |
| Identity Protection (risky sign-ins), Privileged Identity Management (PIM), access reviews | โ |
A handy way to remember: P1 = automation and control (dynamic groups, group licensing, Conditional Access, SSPR). P2 = risk and privileged access (Identity Protection, PIM).
Users
There are two ways to look at a user: where it comes from and what type it is.
- Cloud-only user: created directly in Entra ID. You manage everything in Entra.
- Synchronized user: created in on-premises Active Directory and synced with Entra Connect or Entra Cloud Sync. Most properties (name, department, password) must be changed on-premises, not in the portal.
- Member vs Guest: the
userTypeproperty. Members are "inside" the organisation; guests are external collaborators with fewer default permissions (for example, guests can't browse the full directory by default).
Important user properties for the exam:
- User principal name (UPN): the sign-in name, like
ada@contoso.com. The domain part must be a verified domain in the tenant. - Usage location: the country where the user works. A license cannot be assigned without it, because not every service is available in every country.
- Job info like
department,jobTitle,companyName: often used in dynamic group rules. - Manager: used by some workflows and by access reviews.
You can create users in the portal one at a time, with bulk create (download a CSV template, fill it in, upload it), with Microsoft Graph PowerShell (New-MgUser), with the Azure CLI (az ad user create) or through the Graph API. Bulk operations also exist for invite, delete and "download users".
When you delete a user, it goes to Deleted users for 30 days. Within that time you can restore it with all group memberships and licenses intact. After 30 days it is permanently removed.
"You can't change the department of a user in the portal; the field is greyed out." The user is synchronized from on-premises AD. You change it in on-premises AD and let sync update Entra ID.
Administrative units
An administrative unit (AU) is a container for users, groups or devices that lets you scope a directory role to part of the organisation. Example: the Benelux helpdesk gets the Helpdesk Administrator role scoped to the "Benelux" AU, so they can reset passwords only for Benelux users. Without AUs, directory roles apply to the whole tenant.
Directory roles you should know
Directory roles control what you can do in Entra ID itself (users, groups, settings). They are not the same as Azure RBAC roles like Owner or Contributor, which control Azure resources. Use the least privileged role that does the job:
| Role | Can do |
|---|---|
| Global Administrator | Everything. Keep this to 2โ4 people (plus break-glass accounts). |
| User Administrator | Create and manage users and groups, reset passwords of non-admins, manage some admin passwords. |
| Groups Administrator | Create and manage groups and group settings. |
| Helpdesk Administrator | Reset passwords and invalidate refresh tokens for non-admins and other Helpdesk admins. |
| License Administrator | Assign and remove licenses, edit usage location. |
| Guest Inviter | Invite guests when "members can invite" is turned off. |
Groups
Groups make administration scale: you give access, licenses or apps to a group once, and people inherit it by being a member. Groups have two settings that matter most.
Group type
- Security group: for access to resources (Azure RBAC, apps, file shares) and for licenses. Can contain users, devices, service principals and other groups.
- Microsoft 365 group: for collaboration. Comes with a shared mailbox, calendar, SharePoint site and optionally a Team. Contains users only (no devices, no nested groups).
Membership type
- Assigned: you add and remove members by hand (or a group owner does).
- Dynamic user: membership is calculated from a rule on user properties, for example
(user.department -eq "IT") and (user.usageLocation -eq "NL"). You cannot add members manually. - Dynamic device: a rule on device properties, for example
(device.deviceOSType -eq "Windows"). Only for security groups.
A group's membership type can be changed later (assigned โ dynamic), but a group can't hold users and devices in one dynamic rule. Dynamic rules re-evaluate automatically when user properties change, which can take some minutes.
"You need to add a device to a Microsoft 365 group." That's impossible: M365 groups hold users only. Use a security group. Also: nested groups don't inherit group-based licenses. Only direct members of the licensed group get the license.
Other group settings worth recognising: group owners can manage membership without an admin role; "Microsoft Entra roles can be assigned to the group" must be set at creation time and can't be changed later; and group expiration and naming policies apply to Microsoft 365 groups.
Licenses
Licenses (Entra ID P1/P2, Microsoft 365 E3/E5 and so on) are bought per tenant and then assigned to users. There are two ways:
- Direct assignment: per user. Fine for a handful of people.
- Group-based licensing (needs P1): assign the license to a group, and every direct member gets it. You can also disable individual service plans inside a license (for example, assign Microsoft 365 E3 without Exchange). Combine with a dynamic group and licensing becomes fully automatic.
When group licensing fails for a user, the group shows an error state. The usual reasons are:
- Not enough licenses left in the tenant.
- Usage location missing on the user. Always set it when you create users.
- Conflicting service plans (two licenses that contain mutually exclusive plans).
External users (B2B)
B2B collaboration lets people from other organisations use their own identity (their work account, a Microsoft account, Google, or a one-time email passcode) to access your apps and resources. In your tenant they appear as a guest user object.
The invitation flow works like this:
- An admin or allowed user invites the external email address (portal, bulk CSV, PowerShell or Graph).
- Entra ID creates a guest user object with
userType = Guestand sends an invitation email. - The person redeems the invitation by signing in with their own account and accepting the consent prompt. The guest object's state changes from Pending acceptance to Accepted.
- You can now add the guest to groups, apps and Azure RBAC roles like any other user.
You control B2B in External Identities โ External collaboration settings:
- Guest user access: how much of the directory guests can see (same as members, limited, or most restricted).
- Guest invite settings: who may invite (everyone, members only, only admins and the Guest Inviter role, or nobody).
- Collaboration restrictions: an allow list or a deny list of domains. You can use one or the other, not both.
A separate area, cross-tenant access settings, controls trust with specific other Entra tenants: whether you trust their MFA and device compliance claims, and which users and apps may collaborate inbound or outbound.
B2B collaboration is for partners working with your organisation. Microsoft Entra External ID for customers (formerly Azure AD B2C) is for consumer sign-up and sign-in to your public apps, in a separate external tenant. If a question mentions millions of customers signing up with social accounts, that's External ID, not B2B guests.
Self-service password reset (SSPR)
SSPR lets users reset their own forgotten password, which saves the helpdesk a lot of calls. You configure it under Protection โ Password reset. The settings, in the order the portal shows them:
- Properties: who is enabled. None, Selected (exactly one group, nested groups count) or All. Use Selected to pilot.
- Authentication methods. Choose how many methods are required to reset (1 or 2) and which are available: Microsoft Authenticator notification or code, email, mobile phone (SMS or call), office phone, and security questions. Security questions can be used for SSPR only, never for MFA, and they are the weakest option.
- Registration. "Require users to register when signing in" (Yes/No), and the number of days before users must reconfirm their information (0โ730).
- Notifications. Notify users when their password is reset; notify all admins when another admin resets.
- On-premises integration. Password writeback through Entra Connect or Cloud Sync, so that a reset in the cloud also changes the on-premises AD password. Needs P1.
Two behaviours surprise people:
- Administrators always have SSPR enabled, regardless of the setting above, and they must use two methods (no security questions). This is a separate, stronger policy you can't weaken.
- Users register SSPR and MFA methods on the same page (combined registration at
aka.ms/mysecurityinfo). The actual reset happens ataka.ms/sspror via the "Forgot my password" link on the sign-in page.
"Enable SSPR for the Sales and Marketing groups." SSPR Selected accepts only one group. Create a third group with Sales and Marketing as nested members, or enable it for All.
In AZ-305 you design identity, so expect questions like "which license is the minimum that meets the requirement", "B2B or External ID", "Entra Connect vs Cloud Sync" and "how do you give admins just-in-time access" (PIM, P2). Knowing the P1/P2 split from this chapter answers half of them.
Self-check
1. Group-based licensing fails for one user. The license is available and other members got it. What is the most likely cause?
C. Licenses can't be assigned without a usage location. Dynamic groups and M365 groups both support group licensing.
2. You want all users whose department is "IT" to be added to a group automatically, including new hires. What do you need?
B. Dynamic membership needs P1. Administrative units scope admin roles; they don't grant access.
3. A helpdesk team in Belgium must reset passwords only for Belgian users. What is the least-privilege solution?
D. Administrative units scope directory roles. Azure RBAC roles (Owner) don't control Entra users.
4. You move a subscription to a different Entra tenant. What happens to the existing role assignments?
A. The old identities don't exist in the new tenant, so all RBAC assignments are removed and must be recreated.
5. SSPR is set to None. Can a Global Administrator reset their own password with SSPR?
C. The admin SSPR policy is always on and requires two strong methods.
Lab: users, groups, a guest and SSPR
You create two users and two groups. The group az104-admins is the one you give Azure permissions to in chapter 2, so keep it.
Steps 5 and 6 change tenant-wide settings. Do them in your own lab tenant, not your employer's.
-
Task
Find out which Entra ID edition you have
Find your tenant's license edition. Steps 4 and 6 need P1. If you have Free, start a free 30-day Entra ID P2 trial (P2 includes P1), or skip those steps.
Done when- You know whether you have Free, P1 or P2.
Solution ยท Portal
Microsoft Entra admin center โ Overview: the License field. For a trial: Billing โ Licenses โ All products โ Try / Buy (or the Microsoft 365 admin center โ Billing โ Purchase services).
-
Task
Create two users
Create these cloud users. Use a password you'll remember for Ada; you need it for the SSPR test.
UPN Display name Department Usage location az104-ada@<your domain>Ada (AZ-104) IT your country az104-ben@<your domain>Ben (AZ-104) Finance your country Done when- Both users show in All users with the right department and usage location.
Solution ยท Portal
- Users โ All users โ New user โ Create new user.
- Basics: UPN and display name; choose or auto-generate a password.
- Properties: set Department and Usage location.
- Review + create. Repeat for Ben.
Solution ยท Azure CLI
DOMAIN=$(az rest --url https://graph.microsoft.com/v1.0/domains --query "value[?isDefault].id" -o tsv) az ad user create --display-name "Ada (AZ-104)" --user-principal-name az104-ada@$DOMAIN --password '<choose-a-strong-password>' az ad user create --display-name "Ben (AZ-104)" --user-principal-name az104-ben@$DOMAIN --password '<choose-a-strong-password>' # az ad user create has no department flag, so set it through Microsoft Graph az rest --method PATCH --url "https://graph.microsoft.com/v1.0/users/az104-ada@$DOMAIN" \ --body '{"department":"IT","usageLocation":"NL"}' az rest --method PATCH --url "https://graph.microsoft.com/v1.0/users/az104-ben@$DOMAIN" \ --body '{"department":"Finance","usageLocation":"NL"}' -
Task
Create the group
az104-adminsCreate a security group with assigned membership called
az104-admins. You are the owner and Ada is a member. Chapter 2 gives this group Azure permissions.Done when- The group's Members shows Ada and Owners shows you.
Solution ยท Portal
Groups โ All groups โ New group: Group type Security, name
az104-admins, Membership type Assigned. Under Owners add yourself, under Members add Ada. Create.Solution ยท Azure CLI
az ad group create --display-name az104-admins --mail-nickname az104-admins az ad group member add --group az104-admins --member-id $(az ad user show --id az104-ada@$DOMAIN --query id -o tsv) az ad group owner add --group az104-admins --owner-object-id $(az ad signed-in-user show --query id -o tsv) -
Task ยท needs P1
Create a group that fills itself
Create a security group
az104-dept-itthat automatically contains every user whose department is IT, including future hires. Before saving, test your rule against Ada and Ben.Optional: assign your trial license to this group, then remove Ada's usage location and see what the group reports.
Done when- After a few minutes Ada is a member, Ben isn't.
- You notice you can't add members by hand. Why not?
Hint
Membership type Dynamic User. The rule uses the property
user.department.Solution ยท Portal
- Groups โ New group: type Security, name
az104-dept-it, Membership type Dynamic User. - Add dynamic query: property
department, operator Equals, valueIT. Rule text:(user.department -eq "IT"). - Tab Validate rules: add Ada and Ben and check the result. Save โ Create.
- Optional: Billing โ Licenses โ All products โ your license โ Assign โ group
az104-dept-it.
Solution ยท Azure CLI (through Graph)
az rest --method POST --url https://graph.microsoft.com/v1.0/groups --body '{ "displayName": "az104-dept-it", "mailNickname": "az104-dept-it", "mailEnabled": false, "securityEnabled": true, "groupTypes": ["DynamicMembership"], "membershipRule": "(user.department -eq \"IT\")", "membershipRuleProcessingState": "On" }' -
Task
Invite a guest
First find out who is allowed to invite guests in your tenant and whether there is a domain allow/deny list (just look, don't change). Then invite another email address of your own (a personal Outlook or Gmail) as a B2B guest and redeem the invitation.
Done when- The guest shows User type: Guest and Invitation state: Accepted.
Solution ยท Portal
- External Identities โ External collaboration settings: read Guest invite settings and Collaboration restrictions.
- Users โ New user โ Invite external user: enter the email, Review + invite.
- Open the mail, click Accept invitation, sign in and accept the consent prompt.
Solution ยท Azure CLI (through Graph)
az rest --method POST --url https://graph.microsoft.com/v1.0/invitations --body '{ "invitedUserEmailAddress": "<your-other-email>", "inviteRedirectUrl": "https://myapps.microsoft.com", "sendInvitationMessage": true }' -
Task ยท needs P1
Turn on self-service password reset for a pilot group
Enable SSPR only for members of
az104-admins. Users need one method, either email or the Authenticator app notification, and must register when they sign in.Test it (optional, 5 min): sign in as Ada in a private window, register methods, sign out, then reset her password yourself.
Done when- The Password reset Properties show Selected โ
az104-admins. - (Optional) Ada reset her own password.
Solution ยท Portal
- Protection โ Password reset โ Properties: Selected, group
az104-admins. Save. - Authentication methods: number required 1; tick Email and Mobile app notification. Save.
- Registration: require users to register when signing in = Yes. Save.
- Test: private window โ
https://myaccount.microsoft.comas Ada (MFA registration is also asked) โ sign out โhttps://aka.ms/sspr.
- The Password reset Properties show Selected โ
You now have:
- Users Ada (IT) and Ben (Finance), plus one guest.
- Group
az104-admins(assigned, Ada is a member), which chapter 2 uses for RBAC. - Group
az104-dept-it(dynamic) and SSPR enabled foraz104-admins.
Entra objects cost nothing. You delete them in the chapter 10 cleanup.