Forum Discussion
Pardeep Soba
Nov 17, 2016Copper Contributor
how to change user status in bulk from mfa enabled to disabled.
how to change user status in bulk from mfa enabled to disabled. i am trying the script below which is not working
$users = Import-Csv 'C:\support\BulkUpdateMFASampleFile.csv'
foreach ($user in $users)
{
$st = New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationRequirement
$st.RelyingParty = "*"
$st.State = “Enabled”
$sta = @($st)
Set-MsolUser -UserPrincipalName $user.Username -StrongAuthenticationRequirements $sta
}
1 Reply
Sort By
- Pardeep SobaCopper Contributor
Manage to fix it put an old script and new script together to work it out
$users = Import-Csv 'C:\support\BulkUpdateMFASampleFile.csv'
foreach ($user in $users)
{
$mfa = @()
Set-MsolUser -UserPrincipalName $user.Username -StrongAuthenticationRequirements $mfa
}