Forum Discussion
How to change user passwords in bulk - without force to change
- Oct 25, 2023
I tried them however they didnt work anymore for me I had to use: Import-Csv ".\Sample7users.csv" -Delimiter "," -Encoding UTF8 | ForEach-Object {
$user = Get-AzureADUser -Filter "userPrincipalName eq '$($_.upn)'"
$secureString = ConvertTo-SecureString ($_.pw) -AsPlainText -Force
Set-AzureADUserPassword -ObjectId $user.ObjectID -Password $secureString -ForceChangePasswordNextLogin $false
}
I tried them however they didnt work anymore for me I had to use: Import-Csv ".\Sample7users.csv" -Delimiter "," -Encoding UTF8 | ForEach-Object {
$user = Get-AzureADUser -Filter "userPrincipalName eq '$($_.upn)'"
$secureString = ConvertTo-SecureString ($_.pw) -AsPlainText -Force
Set-AzureADUserPassword -ObjectId $user.ObjectID -Password $secureString -ForceChangePasswordNextLogin $false
}