locked
Active Directory Bulk Password Change RRS feed

  • Question

  • For compliance we have to reset all the AD users passwords. So we exported the AD users to a 2010 Excel Spreadsheet.  Then we generated new passwords and imported them into the 2010 Excel Spreadsheet.

    Now we are trying to figure out how to import the new generated passwords back into AD that has been assigned to each user and set the password to never expire.

    Any help will be greatly appreciated.

    Thank you.


    • Edited by CFSD6 Sunday, June 8, 2014 12:50 PM
    Sunday, June 8, 2014 12:50 PM

Answers

  • Hi,

    Try the following, this assumes you have saved your spreadsheet as a CSV and you have column headers with the username under a header of username and the password in plain text under a header of password.

    run the following from a PowerShell prompt (obviously using the correct file path!!)

    [PS]> $Users = Import-Csv c:\users.csv
    [PS]> $Users | foreach{Set-ADAccountPassword –Identity $_.Username -Reset -NewPassword (ConvertTo-SecureString -AsPlainText $_.Password –Force)

    before doing this on a Live AD you might want to either test in a lab to ensure you get what your expecting or use the -whatif parameter to simulate what would be done. (or of course you could just do it on a couple of test accounts)

    I've never needed to do this myself but have a fair bit of experience with PowerShell.

    Daniel

    • Proposed as answer by Daniel Caulfield Sunday, June 8, 2014 2:18 PM
    • Marked as answer by CFSD6 Monday, June 9, 2014 1:34 PM
    Sunday, June 8, 2014 2:18 PM

  • You can check the given link related to your question how to change bulk AD password.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/b0c2e59f-522e-40a3-ab12-3a95d045d6a8/how-can-reset-password-of-bulk-users-in-one-time-through-ad-or-script?forum=winserverpowershell and if you want to automated this task,
    • Marked as answer by CFSD6 Monday, June 9, 2014 1:34 PM
    • Edited by JamesRL Monday, June 4, 2018 5:15 PM
    Monday, June 9, 2014 10:06 AM

All replies

  • Hi,

    Try the following, this assumes you have saved your spreadsheet as a CSV and you have column headers with the username under a header of username and the password in plain text under a header of password.

    run the following from a PowerShell prompt (obviously using the correct file path!!)

    [PS]> $Users = Import-Csv c:\users.csv
    [PS]> $Users | foreach{Set-ADAccountPassword –Identity $_.Username -Reset -NewPassword (ConvertTo-SecureString -AsPlainText $_.Password –Force)

    before doing this on a Live AD you might want to either test in a lab to ensure you get what your expecting or use the -whatif parameter to simulate what would be done. (or of course you could just do it on a couple of test accounts)

    I've never needed to do this myself but have a fair bit of experience with PowerShell.

    Daniel

    • Proposed as answer by Daniel Caulfield Sunday, June 8, 2014 2:18 PM
    • Marked as answer by CFSD6 Monday, June 9, 2014 1:34 PM
    Sunday, June 8, 2014 2:18 PM
  • Daniel:

    Looks like a good way to go.  But how do you code for the following ?

    AD Tree:

       Onboard Users

                       group 1

                       group 2

                       group 3

    So I want to change the following:

    AD Tree - Onboard Users - group 2

    Thank you.

    Sunday, June 8, 2014 10:09 PM

  • You can check the given link related to your question how to change bulk AD password.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/b0c2e59f-522e-40a3-ab12-3a95d045d6a8/how-can-reset-password-of-bulk-users-in-one-time-through-ad-or-script?forum=winserverpowershell and if you want to automated this task,
    • Marked as answer by CFSD6 Monday, June 9, 2014 1:34 PM
    • Edited by JamesRL Monday, June 4, 2018 5:15 PM
    Monday, June 9, 2014 10:06 AM
  • Hi Daniel

    Sorry to re-open an old thread.  I'm trying to use your suggested commands above (changing the path to my .csv) but when I run the second line I just get the >>, as if it's waiting for further commands.  Any ideas where I'm going wrong?

    Any assistance much appreciated.

    Paul

    Tuesday, December 9, 2014 10:49 AM