Forum Discussion

Pardeep Soba's avatar
Pardeep Soba
Copper Contributor
Nov 17, 2016

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

  • Pardeep Soba's avatar
    Pardeep Soba
    Copper 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

    }

Resources