Bird
Raised Fist0
Azurecloud~10 mins

Multi-factor authentication in Azure - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable multi-factor authentication (MFA) for a user in Azure AD.

Azure
az ad user update --id user@example.com --[1]
Drag options to blanks, or click blank then click option'
Amfa
Benable-mfa
Cforce-change-password-next-login
Dforce-mfa
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enable-mfa' which is not a valid Azure CLI option.
Confusing password reset options with MFA enforcement.
2fill in blank
medium

Complete the code to create a Conditional Access policy that requires MFA for all users.

Azure
az ad conditional-access policy create --display-name "Require MFA" --state enabled --conditions users [1] --grant-controls operator RequireMultiFactorAuth
Drag options to blanks, or click blank then click option'
Ainclude
Bexclude
Call-users
Dnone
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'exclude' which would exclude users from the policy.
Using 'none' which applies to no users.
3fill in blank
hard

Fix the error in the command to enable MFA registration enforcement for all users.

Azure
az ad mfa [1] --all-users
Drag options to blanks, or click blank then click option'
Aenforce
Bregister
Cenable
Drequire
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enable' which is not a valid subcommand here.
Using 'register' which is not a recognized command.
4fill in blank
hard

Fill both blanks to configure a Conditional Access policy that targets users and requires MFA.

Azure
az ad conditional-access policy create --display-name "MFA Policy" --state enabled --conditions users [1] --grant-controls operator [2]
Drag options to blanks, or click blank then click option'
Ainclude
BRequireMultiFactorAuth
Cexclude
DRequirePasswordChange
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'exclude' which would skip users.
Using 'RequirePasswordChange' which is unrelated to MFA.
5fill in blank
hard

Fill all three blanks to create a policy that includes all users, excludes guests, and requires MFA.

Azure
az ad conditional-access policy create --display-name "Secure Access" --state enabled --conditions users [1] --exclude-users [2] --grant-controls operator [3]
Drag options to blanks, or click blank then click option'
Ainclude
Bguests
CRequireMultiFactorAuth
Dall-users
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'all-users' with 'include' in the first blank.
Using 'RequirePasswordChange' instead of MFA enforcement.

Practice

(1/5)
1. What is the main purpose of Multi-factor Authentication (MFA) in Azure?
easy
A. To provide free cloud storage
B. To speed up the login process
C. To allow users to reset their passwords automatically
D. To add an extra step to verify user identity for better security

Solution

  1. Step 1: Understand MFA concept

    MFA requires users to provide two or more verification methods to prove their identity.
  2. Step 2: Identify MFA's main goal

    This extra verification step improves security by making unauthorized access harder.
  3. Final Answer:

    To add an extra step to verify user identity for better security -> Option D
  4. Quick Check:

    MFA = extra verification step [OK]
Hint: MFA means more than one way to prove who you are [OK]
Common Mistakes:
  • Thinking MFA speeds up login
  • Confusing MFA with password reset
  • Assuming MFA provides storage
2. Which of the following is the correct PowerShell command to enable MFA for a user in Azure AD?
easy
A. Set-MsolUser -UserPrincipalName user@example.com -StrongAuthenticationRequirements @(@{RelyingParty="*";State="Enabled"})
B. Enable-MsolUser -UserPrincipalName user@example.com -StrongAuthenticationRequirements @()
C. New-MsolUser -UserPrincipalName user@example.com -EnableMFA $true
D. Add-MsolUser -UserPrincipalName user@example.com -MFAEnabled

Solution

  1. Step 1: Recall correct MFA enabling syntax

    In Azure AD PowerShell, enabling MFA uses Set-MsolUser with StrongAuthenticationRequirements set to enabled.
  2. Step 2: Match command to syntax

    Set-MsolUser -UserPrincipalName user@example.com -StrongAuthenticationRequirements @(@{RelyingParty="*";State="Enabled"}) correctly uses Set-MsolUser with StrongAuthenticationRequirements array containing State="Enabled".
  3. Final Answer:

    Set-MsolUser -UserPrincipalName user@example.com -StrongAuthenticationRequirements @(@{RelyingParty="*";State="Enabled"}) -> Option A
  4. Quick Check:

    Enable MFA = Set-MsolUser + StrongAuthenticationRequirements enabled [OK]
Hint: Look for Set-MsolUser with StrongAuthenticationRequirements enabled [OK]
Common Mistakes:
  • Using Enable-MsolUser which does not exist
  • Confusing New-MsolUser with enabling MFA
  • Using Add-MsolUser which is invalid
3. Consider this Azure AD MFA policy snippet:
{"state": "enabled", "methods": ["phoneAppNotification", "sms"]}

What happens when a user tries to sign in?
medium
A. User must use a hardware token only
B. User can sign in without any additional verification
C. User must verify identity using either phone app notification or SMS code
D. User is blocked from signing in

Solution

  1. Step 1: Analyze MFA policy state

    The policy state is "enabled", so MFA is active and required.
  2. Step 2: Check allowed verification methods

    Methods include phone app notification and SMS, so user can use either to verify.
  3. Final Answer:

    User must verify identity using either phone app notification or SMS code -> Option C
  4. Quick Check:

    MFA enabled means verification required via allowed methods [OK]
Hint: Enabled MFA means user must verify by one allowed method [OK]
Common Mistakes:
  • Thinking user can skip verification
  • Assuming user is blocked
  • Believing only hardware tokens work
4. You configured MFA for a user but they report they are not prompted for the second factor. What is the most likely cause?
medium
A. The user is excluded from MFA in the conditional access policy
B. The user has not logged in for 30 days
C. The user's password is expired
D. The user is using a supported MFA method

Solution

  1. Step 1: Understand why MFA prompt might be skipped

    If a user is excluded in conditional access policies, MFA won't be enforced for them.
  2. Step 2: Evaluate other options

    Login inactivity or password expiry do not disable MFA prompts; supported methods enable MFA.
  3. Final Answer:

    The user is excluded from MFA in the conditional access policy -> Option A
  4. Quick Check:

    Exclusion in policy = no MFA prompt [OK]
Hint: Check if user is excluded in conditional access policies [OK]
Common Mistakes:
  • Assuming password expiry disables MFA
  • Thinking inactivity disables MFA
  • Confusing supported methods with disabling MFA
5. You want to enforce MFA only when users access sensitive Azure resources from outside your corporate network. Which Azure feature should you use to achieve this?
hard
A. Enable MFA for all users unconditionally
B. Conditional Access policies with location-based conditions
C. Azure AD Identity Protection without conditions
D. Use Azure Firewall to block all external access

Solution

  1. Step 1: Identify feature for conditional MFA enforcement

    Conditional Access policies allow setting MFA requirements based on conditions like user location.
  2. Step 2: Match requirement to feature

    Location-based conditions in Conditional Access enable MFA only outside corporate network.
  3. Step 3: Evaluate other options

    Identity Protection without conditions cannot target location; unconditional MFA applies everywhere; firewall blocks access but does not enforce MFA.
  4. Final Answer:

    Conditional Access policies with location-based conditions -> Option B
  5. Quick Check:

    Conditional Access + location = targeted MFA [OK]
Hint: Use Conditional Access with location rules for targeted MFA [OK]
Common Mistakes:
  • Using unconditional MFA for all users
  • Relying on Identity Protection without conditions
  • Blocking access instead of enforcing MFA
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard