Set-AzureADUserPassword -ObjectId $UserId -Password $NewPassword -ForceChangePasswordNextLogin $True #Set the password value and set force change password at next login flag Write-Progress -activity "Processing $UserId " -status "$i out of $TotalRecords users completed" $NewPassword = ConvertTo-SecureString $CSVRecord.'Password' -AsPlainText -Force #Array to add the status users one by one and set the password $CSVRecords = Import-CSV "C:\Temp\AzureADUsersPwd.csv" The following script imports the user details from the CSV file and sets the password value in Azure AD for users one by one. Consider the CSV file “AzureADUsersPwd.csv” ( Download sample CSV) which holds the user details in each row with the column headers UserPrincipalName and Password. To set a temporary password for users in bulk, we can keep the required user details (UPN and Password) in a CSV file. Set Password for Bulk Microsoft 365 users by Import details from CSV Message: The specified password does not comply with password complexity requirements. Set-AzureADUserPassword : Error occurred while executing SetUser Code: Request_BadRequest Otherwise, you will get the below error message. You need to provide a strong password that complies with your password policy complexity. Set-AzureADUserPassword -ObjectId " " -Password $NewPassword -ForceChangePasswordNextLogin $True #Set the new password and set force change password at next login flag $NewPassword = ConvertTo-SecureString -AsPlainText -Force
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |