Forum Discussion
ABill1
Oct 24, 2023Iron Contributor
How to change user passwords in bulk - without force to change
Hello everyone, I'm in the process of updating the passwords for multiple users, and I'd like to set specific passwords of my choice. Additionally, I want to ensure that these accounts won't prom...
- 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
}
ABill1
Oct 25, 2023Iron Contributor
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
}