Source: Microsoft 365 / Entra ID / Intune for IT Admins, Module 9. Lab demo · sample data. Demo tenant on an E5 trial, demo user jlim@demo.onmicrosoft.com. Test in a lab first — do not run this on a production tenant.
The problem: Your password was stolen. The attacker has it. They try to sign in from the other side of the world at 2 a.m. — and they fail. Why? Because your password was only the first check, and the second check was your phone, in your pocket, and you said no. That is multi-factor authentication (MFA).
Watch it first: Full walkthrough — Module 9 of Microsoft 365 / Entra ID / Intune for IT Admins. Watch the course: https://www.youtube.com/playlist?list=PLBA5bJxXWQK8
The slow way: In the portal, per-user MFA is one switch, for one user, always on or always off. It works, but it is clumsy, and you cannot add conditions to it.
The fast way: Use Conditional Access. One policy: all users, all cloud apps, require MFA. That needs Entra ID P1, which the E5 trial includes.
1. Register a second factor for a demo user
Connect-MgGraph -Scopes "UserAuthenticationMethod.ReadWrite.All"
Get-MgUser -Filter "userPrincipalName eq 'jlim@demo.onmicrosoft.com'"
New-MgUserAuthenticationPhoneMethod -UserId "jlim@demo.onmicrosoft.com" -PhoneNumber "+65 80000000" -PhoneType "mobile"
That number is a fake sample number. Start everyone on the Microsoft Authenticator app, not SMS. Number matching matters. Teach your users: never approve a sign-in you did not start. If your phone buzzes and you are not signing in right now, tap Deny, and tell IT.
2. Require MFA with Conditional Access
Build one Conditional Access policy for all users, test it on a small group first, then roll it out to everyone.
3. Prove it works — deny, and watch it block
Sign in as the demo user in a private browser window. Password: accepted. Phone buzzes, approve. Signed in, in about ten seconds. Now sign in again and tap Deny. The sign-in is blocked. Prove it in the logs:
Get-MgAuditLogSignIn -Filter "userPrincipalName eq 'jlim@demo.onmicrosoft.com'"
— look for Status Failure, MFA denied by user.
If it fails
Locked out? Keep two emergency access accounts, with very long passwords stored safely offline, excluded from the MFA policy. Users keep calling the helpdesk? Tell them first, roll it out in small groups. One lost phone locked a user out? Register a second method. SMS codes are not arriving? Use the Authenticator app with number matching.
Tools used in this fix
Disclosure: This post contains affiliate links. If you buy through them, Click Less, Script More may earn a commission at no extra cost to you. Only tools used or shown in this lesson are linked.
Microsoft 365 — the plan used in this lab: https://www.microsoft.com/en-us/microsoft-365
Next step: Module 10 builds on this policy with Conditional Access rules for risky sign-ins and compliant devices.