Skip to content
Visual explainer 2h 30m to learn 5 steps

Set up a lab tenant and safe admin access

Prepare a lab tenant with a verified domain, separate admin accounts and emergency access, and check licences.

By Invicly Tech, , in Microsoft Entra & Microsoft 365 Administration. About 11 minutes to read.

Topic 2 of 31

In short

A safe lab starts with a tenant you can break without hurting real people, a custom domain you have proved you own, and admin accounts kept apart from everyday accounts. Two emergency access accounts protect you from locking everyone out. Before planning any feature, check which licences the tenant actually has.

Think of it like this: Emergency access accounts are the spare key in a sealed envelope in the office safe: almost never used, always checked, and opening it raises an alarm.

Explained simply

Admin work is learned by doing, and doing means making mistakes. So you need a lab tenant: a separate Entra directory with fake users, where a wrong click locks out nobody real. Never practise on your employer's tenant.

There are a few ways to get one. Microsoft 365 trials, such as Business Premium or E5, usually last about a month and may ask for a payment method. The Microsoft 365 Developer Program sandbox is free but now only for qualifying members. A free Azure account also creates an Entra tenant with the Free tier.

Next, add a domain you control. Entra gives you a DNS record to publish, usually a TXT record that starts with MS=. When Entra sees it, the domain is verified and users can sign in with it. If you own no domain, stay on .onmicrosoft.com; that is fine for a lab.

Then split your accounts. Your everyday account reads mail and browses the web. Your admin account does admin work and nothing else. That way a phishing email opened in your inbox does not hand over admin rights.

Finally, create two emergency access accounts. These are spare Global Administrators for the day when MFA, federation or a bad policy blocks every other admin. They are kept cloud-only, protected with strong sign-in such as a passkey, watched with alerts and tested on a schedule.

Press Play on a diagram to walk through it one step at a time.

FlowPreparing a lab tenant
  1. 1
    Get a tenant

    Trial, developer sandbox or free Entra tenant

  2. 2
    Add a domain

    Add contoso-lab.example and a TXT record

  3. 3
    Verify

    Entra checks DNS and marks the domain verified

  4. 4
    Split accounts

    Daily account plus a separate admin account

  5. 5
    Break-glass

    Two cloud-only emergency Global Administrators

  6. 6
    Check licences

    Licenses page in Entra or Billing in Microsoft 365

CompareEveryday account vs admin account vs emergency account
Everyday
  • anna@contoso.com
  • Licensed with mailbox
  • No admin roles
  • Normal MFA
Admin
  • adm-anna@contoso.onmicrosoft.com
  • Usually no licence
  • Narrow roles, ideally eligible
  • Strong MFA, trusted device
Emergency
  • Cloud-only .onmicrosoft.com
  • Permanent Global Administrator
  • Passkey or certificate in a safe
  • Alert on every use

In depth

Choosing a lab tenant

Pick the option that gives you the features you plan to practise. A free Entra tenant, created with a free Azure account, has users, groups and basic sign-in logs, but no Conditional Access, dynamic groups or PIM, and no Exchange or Teams. A Microsoft 365 Business Premium trial adds Exchange, Teams, SharePoint, Intune and Entra ID P1. An E5 trial adds Entra ID P2, which brings PIM and ID Protection.

The Microsoft 365 Developer Program used to hand out free E5 sandboxes to anyone; today only qualifying members, such as some Visual Studio subscribers, get one. Check the program page for the current rules. If none of these work for you, every lab in this path has a tenant-free version using synthetic records, and you can still learn the design and the evidence to expect.

  • Free Entra tier: users, groups, basic logs
  • Business Premium trial: Microsoft 365 apps, Intune, Entra ID P1
  • E5 trial: adds Entra ID P2 (PIM, ID Protection)
  • Trials are time-limited; note the end date
  • No tenant: use the synthetic-record labs

Verifying a custom domain

In the Entra admin center, go to Identity, Settings, Domain names, then Add custom domain. Enter a domain you control, for example contoso-lab.example. Entra shows a TXT value such as MS=ms12345678 (an MX alternative is also offered). Add that record at your DNS host, wait for it to appear, then select Verify.

The record proves you control the domain. Once verified, you can make it the default for new users and, later, add the extra records Microsoft 365 needs for mail, such as MX, SPF and autodiscover. Keep the verification record in place; removing it does not unverify the domain, but it is useful evidence. To check propagation before clicking Verify, query DNS yourself.

SequenceDomain verification handshake
Admin
Entra ID
DNS host
  1. 1Add custom domain contoso-lab.example
    Admin to Entra ID: Add custom domain contoso-lab.example
  2. 2Publish TXT MS=ms12345678
    Entra ID to Admin: Publish TXT MS=ms12345678
  3. 3Create TXT record at the zone apex
    Admin to DNS host: Create TXT record at the zone apex
  4. 4Select Verify
    Admin to Entra ID: Select Verify
  5. 5Look up TXT records
    Entra ID to DNS host: Look up TXT records
  6. 6Domain marked verified
    Entra ID to Admin: Domain marked verified

Separate admin accounts and delegated partners

Give each administrator two identities: anna@contoso.com for daily work and something like adm-anna@contoso.onmicrosoft.com for admin tasks. The admin account usually needs no mailbox, so it needs no Microsoft 365 licence, and Conditional Access can demand stronger sign-in for it. Use it from a trusted device and sign out when done.

Some organisations let an outside IT provider manage the tenant. Microsoft's Granular Delegated Admin Privileges (GDAP) lets a partner hold specific roles for a fixed time rather than permanent Global Administrator. If a partner relationship exists, review it under Partner relationships in the Microsoft 365 admin center, and remove any you do not recognise.

  • Daily account: mail, Teams, web browsing
  • Admin account: admin portals only, no mailbox
  • Name admin accounts so they stand out in logs
  • Partners: prefer GDAP with time limits

Emergency access accounts done properly

Microsoft recommends at least two emergency access accounts. Make them cloud-only on the .onmicrosoft.com domain, so a DNS or federation outage cannot block them. Give them a permanent Global Administrator assignment, not an eligible one, so no extra activation step can fail.

Because Microsoft now requires MFA for admin portals, protect these accounts with a phishing-resistant method such as a FIDO2 passkey or certificate-based authentication, kept in a safe place by different people. Exclude at least one from Conditional Access policies that could lock it out, and document why. Then set an alert on any sign-in by these accounts, for example a Log Analytics alert on the sign-in logs, and test them every few months.

  • Two or more accounts, cloud-only
  • Permanent Global Administrator
  • Passkey or certificate, stored securely
  • Alert on every sign-in; test on a schedule

Checking which licences you have

Many features depend on licences, so check before you design. In the Microsoft 365 admin center, Billing then Licenses (or Your products) lists each subscription and how many seats are assigned. In the Entra admin center, the Overview page shows the tenant's Entra edition, such as Free, P1 or P2. With Graph PowerShell, Get-MgSubscribedSku lists each SKU part number and the seats used.

Read SKU names carefully. SPB is Microsoft 365 Business Premium, ENTERPRISEPREMIUM is Office 365 E5, and SPE_E5 is Microsoft 365 E5. The service plans inside each SKU tell you whether it includes AAD_PREMIUM (P1) or AAD_PREMIUM_P2.

Learn it in 5 short steps

About 30m each. Track them with a timer in your plan.

  1. 1
    Get a lab or trial tenant~30m
  2. 2
    Verify a custom domain~30m
  3. 3
    Use separate admin accounts~30m
  4. 4
    Create emergency access accounts~30m
  5. 5
    Check which licences you have~30m

Key points

  • Never practise in a production tenant; use a trial, a developer sandbox if you qualify, or a free tenant.
  • Domain ownership is proved with a DNS TXT (or MX) record that Microsoft gives you.
  • Admins use a separate, unlicensed or lightly licensed admin account, not their mailbox account.
  • Keep two cloud-only emergency accounts on the .onmicrosoft.com domain with phishing-resistant sign-in.
  • Check licences before designing: many features need Entra ID P1 or P2.

Key terms

Tap a card to flip it. 0/4 known

Examples

Verifying contoso-lab.example step by step

Prerequisites: a lab tenant, a domain you own and access to its DNS. Step 1: in Entra, Domain names, add contoso-lab.example. Step 2: copy the TXT value. Step 3: create the TXT record at the zone apex (host @) with a TTL of 3600. Step 4: query DNS until the value appears. Step 5: select Verify. Expected evidence: Status shows Verified. Rollback: remove the domain in Entra (only possible when no users, groups or apps use it), then delete the DNS record.

bash
# check that the TXT record is visible before clicking Verify
dig +short TXT contoso-lab.example
# expected output includes:
# "MS=ms12345678"

# Windows alternative
nslookup -type=TXT contoso-lab.example

Creating an emergency access account in a lab

Step 1: create the user breakglass1@contoso.onmicrosoft.com with a long random password stored in a sealed record. Step 2: assign Global Administrator as an active, permanent assignment. Step 3: sign in once, register a FIDO2 passkey, and store the key securely. Step 4: exclude the account from your lab Conditional Access policies and note why. Step 5: confirm a sign-in shows up in the sign-in logs and triggers your alert. Repeat for breakglass2. Cleanup in a lab: delete the accounts when the tenant expires.

powershell
Connect-MgGraph -Scopes "User.ReadWrite.All"
$pw = @{ Password = "<long-random-value>"; ForceChangePasswordNextSignIn = $false }
New-MgUser -DisplayName "Emergency access 1" `
  -UserPrincipalName "breakglass1@contoso.onmicrosoft.com" `
  -MailNickname "breakglass1" -AccountEnabled `
  -PasswordProfile $pw
# Assign Global Administrator in Entra: Roles and admins, Global Administrator, Add assignments

Quick reference

  • Never practise in production; use a trial, a qualifying developer sandbox or a free tenant.
  • Domain proof: add the MS=ms######## TXT record, then select Verify.
  • Admins: separate admin account, no mailbox, strong MFA, trusted device.
  • Keep at least two cloud-only emergency Global Administrators on .onmicrosoft.com.
  • Protect emergency accounts with a passkey or certificate; alert on every sign-in.
  • Licences: Microsoft 365 admin center, Billing, Licenses; or Get-MgSubscribedSku.
  • Entra ID P1: Conditional Access, dynamic groups. P2: PIM, ID Protection.

Common mistakes

  • Signing up for the lab with your work account, so the trial lands in your company tenant.
  • Syncing emergency accounts from on-premises; they must be cloud-only so they work when sync or federation breaks.
  • Creating emergency accounts and never testing them or alerting on their use.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1Why should emergency access accounts use the .onmicrosoft.com domain?

Question 2

2Which DNS record type does Entra most often ask for to verify a domain?

Question 3

3An admin reads mail and approves invoices with the same account that holds User Administrator. What is the main risk?

Question 4

4Which licence tier do you need for Privileged Identity Management?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Write down the three accounts a lab administrator called Ben should have, with a sample name and purpose for each.

  2. Exercise 2medium

    Your lab tenant shows SPB with 25 seats. List three features you can practise and one you cannot, and say why.

  3. Exercise 3hard

    Write a one-page emergency access runbook: who holds the credentials, how the accounts are protected, how use is detected, how often they are tested, and what to do after use.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Can I get a free Microsoft 365 tenant for practice?
Sometimes. The Developer Program sandbox is free for qualifying members, and trials are free for a limited time. A free Azure account gives a free Entra tenant without Microsoft 365 services.
Do I need to own a domain for the labs?
No. You can do almost every lab with the .onmicrosoft.com domain. A cheap domain only helps you practise verification and mail DNS records.
Should emergency accounts have MFA?
Yes. Microsoft now enforces MFA for admin portals, so give them a phishing-resistant method such as a FIDO2 passkey or certificate, stored securely.
How many Global Administrators should a tenant have?
As few as possible: Microsoft suggests fewer than five, plus the emergency accounts. Most admin work can use narrower roles.

Go deeper

ShareXLinkedInWhatsApp