Hi
I'm looking to reset in bulk AD user account passwords. I have this script:
# # Script: ResetPwd.ps1 # Description: Reset the password for bulk number of users, and # set the property to change passwrod required at next logon # # Written by: Anand Venkatachalapathy # Import-Module ActiveDirectory # Set the default password $password = ConvertTo-SecureString -AsPlainText “AwesomeP@ssw0rd” -Force # Get the list of accounts from the file on file # List the user names one per line $users = Get-Content -Path c:\MyScripts\UserList.txt ForEach ($user in $users) { # Set the default password for the current account Get-ADUser $user | Set-ADAccountPassword -NewPassword $password -Reset #If you need to set the property “Change password at next logon”, #leave the next alone. If not, comment the next line Get-ADUser $user | Set-AdUser -ChangePasswordAtLogon $true Write-Host “Password has been reset for the user: $user” } # ————- End ———–
Credit: http://anandthearchitect.com/2014/02/27/active-directory-bulk-user-password-reset-by-powershell/
This works, however it only lets me set each password to be the same. I'd like to have a second column in a source .csv which lists a unique password per user and have the script change the password as per the file. Can anyone assist with the necessary changes to the above? My experience with Powershell is very limited.
Any assistance is very much appreciated.
Paul