AntiMalware Status

Reset Password for user in Active Directory

Quick Help Desk script tool in PowerShell to reset user password :

Import-Module ActiveDirectory

$newpwd = Read-Host "[ Enter the new password ]" -AsSecureString
$User = Read-Host "[ Enter UserName ]"

Write-Host .. Password Reset for $user -ForegroundColor white -BackgroundColor Red

Set-ADAccountPassword $User -NewPassword $newpwd –Reset

Write-Host "[ Change Report ]" -ForegroundColor -white -BackgroundColor green
Get-ADuser -identity $User -Properties * | Select-Object SamAccountName,PasswordLastSet,Enabled | Format-List
  • Enter new password for the user
  • Enter username for user you are trying to reset password
  • Shows result for the user that password has been reset

Force the user to change password on first login you need to run this line :

Set-ADUser -identity $User -ChangePasswordAtLogon:$True

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.