Wednesday, November 18, 2009

Change multiple user password using command line

Quest QAD shell provides a very useful interface to do this often required task. The beautiful part is that you do not need to provide the password as a Secure string.

Set-QADUser –Identity –UserPassword -UserMustChangePassword $True

The above command will set the password for User to the one specified in this command.

Import-Csv UserList.csv | foreach {Set-QADUser -Identity $_.UserName -Password $_.UserPassword -UserMustChangePassword $True}

The above command will read the UserName and UserPassword from and excel sheet UserList.csv and will set them accordingly. You need to keep the row headers as UserName and UserPassword in the CSV. The most important feature here is that you can have a different password for each individual user in the sheet.

------------ End of Document ------------------------
Tags: Active Directory, PowerShell,
Published Date: 20091118

No comments: