Hi @Aran Billen ,
if your csv looks like this (for example Sample7users.csv
):
upn,pw
testpeter@test.net,ThisIsTheNewPassword12345?
testpaul@test.net,ThisIsTheNewPassword7890?
this PowerShell script should work (tested):
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
}
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten