Site icon Franky's Web

Active Directory: Resetting passwords for multiple users via Powershell

If you want to quickly reset a large number of passwords, you can use Powershell to do this. With a small adjustment, you can also read in a CSV file with users and reset the passwords to a default password:

$userlist= @()
do {
$input = (Read-Host "AD User")
if ($input -ne '') {$userlist += $input}
}
until ($input -eq '')

foreach ($user in $userlist)
{
write-host "Setze Passwort für $user"
get-aduser $user | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "MeinPasswort" -Force)
}
Exit mobile version