Closed psoba closed 8 years ago
PS C:\windows\System32> $users = Import-Csv 'C:\support\BulkUpdateMFASampleFile - Copy.csv' foreach ($user in $users) { $st = New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationRequirement $st.RelyingParty = "*" $st.State = “Enabled” $sta = @($st) Set-MsolUser -UserPrincipalName $user -StrongAuthenticationRequirements $sta } Set-MsolUser : User Not Found. User: . At line:8 char:5
- CategoryInfo : OperationStopped: (:) [Set-MsolUser], MicrosoftOnlineException - FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.UserNotFoundException,Microsoft.Online.Administration.Automation.SetUser
please can you assist what the incorrect syntax is it keeps failing. i am trying to bulk update MFA for a list of users in a CSV
PS C:\windows\System32> $users = Import-Csv 'C:\support\BulkUpdateMFASampleFile - Copy.csv' foreach ($user in $users) { $st = New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationRequirement $st.RelyingParty = "*" $st.State = “Enabled” $sta = @($st) Set-MsolUser -UserPrincipalName $user -StrongAuthenticationRequirements $sta } Set-MsolUser : User Not Found. User: . At line:8 char:5