Jan 25 2021
11:57 PM
- last edited on
Jan 14 2022
04:26 PM
by
TechCommunityAP
Jan 26 2021 12:10 AM
There are sample steps here: https://docs.microsoft.com/en-us/azure/active-directory/authentication/howto-mfa-userstates#change-s...
All you need to do is change the $users line to import the CSV.
Or look up an ready-to-use script online, I'm sure there are few avaialble.
Feb 01 2021 06:43 PM
Solution
HOW TO ENABLE OFFICE 365 MFA USING POWERSHELL AND CSV FILE
UserPrincipalName |
user1@contoso.com |
user2@contoso.com |
user3@contoso.com |
user4@contoso.com |
user5@contoso.com |
user6@contoso.com |
user7@contoso.com |
user8@contoso.com |
user9@contoso.com |
2. Run script BELOW (change the path and name of your csv file)
Connect-MsolService
$users = Import-Csv C:\Users\csv \enablemfa.csv
foreach ($user in $users)
{ $st = New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationRequirement $st.RelyingParty = "*" $st.State = "Enabled" $sta = @($st) Set-MsolUser -UserPrincipalName $user.UserPrincipalName -StrongAuthenticationRequirements $sta }
Write-Host "DONE RUNNING SCRIPT"
Read-Host -Prompt "Press Enter to exit" |