MS2011 Posted January 11, 2016 Posted January 11, 2016 Dear all, I have all the AD users in a CSV file and want to reset the password for all. The password will be the same for all of them. Can someone guide me how to do it? Many thanks, MS
FN-GM Posted January 11, 2016 Posted January 11, 2016 (edited) Are they all in the same OU? This should reset all user passwords in the OU you specify and with the password you choose. Get-ADUser -SearchBase "OU=Accounts,OU=RootOU,DC=ChildDomain,DC=RootDomain,DC=com" -Filter * | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "p@ssw0rd" -Force) Edited January 11, 2016 by FN-GM 1
zag Posted January 11, 2016 Posted January 11, 2016 Just for info, if you select them all in AD users and computers you can reset the password for all of them at the same time. Just right click and properties. There is no need to use powershell for this really.
MS2011 Posted January 11, 2016 Author Posted January 11, 2016 There is no password change option through AD user account properties.
halbaradkenafin Posted January 11, 2016 Posted January 11, 2016 Dear all, I have all the AD users in a CSV file and want to reset the password for all. The password will be the same for all of them. Can someone guide me how to do it? Many thanks, MS My approach if you've got a csv would be: $users = Import-Csv -path C:\Path\To\file.csv Foreach ($user in $users) { Get-ADUser -Identity $User.Username | Set-ADAccountPassword -NewPassword (ConvertTo-SecureString "Password1" -AsPlaintext -Force) -reset } Just for info, if you select them all in AD users and computers you can reset the password for all of them at the same time. Just right click and properties. There is no need to use powershell for this really. That will let you set the password to expire or set the passwords to be changed at next login but not actually change the passwords to the same thing. 1
SHimmer45 Posted January 11, 2016 Posted January 11, 2016 if the get-aduser can use the -path like new-aduser you could specify where the user is specifically
MS2011 Posted January 11, 2016 Author Posted January 11, 2016 Hi, i have all the users in the OU "Users" and Sub OU "accounts". Say for example my domain is test.co.uk Get-ADUser -SearchBase "OU=Users,OU=accounts,DC=test,DC=co,DC=uk" -Filter * | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "p@ssw0rd" -Force)
MS2011 Posted January 11, 2016 Author Posted January 11, 2016 Are they all in the same OU? This should reset all user passwords in the OU you specify and with the password you choose. Get-ADUser -SearchBase "OU=Accounts,OU=RootOU,DC=ChildDomain,DC=RootDomain,DC=com" -Filter * | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "p@ssw0rd" -Force) Hi, i have all the users in the OU "Users" and Sub OU "accounts". Say for example my domain is test.co.uk Get-ADUser -SearchBase "OU=Users,OU=accounts,DC=test,DC=co,DC=uk" -Filter * | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "p@ssw0rd" -Force)
halbaradkenafin Posted January 11, 2016 Posted January 11, 2016 Hi, i have all the users in the OU "Users" and Sub OU "accounts". Say for example my domain is test.co.uk Get-ADUser -SearchBase "OU=Users,OU=accounts,DC=test,DC=co,DC=uk" -Filter * | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "p@ssw0rd" -Force) If "Accounts" is a sub OU of "Users" then you want to swap those around in your SearchBase string. Just make sure you don't have any important accounts (domain admins etc) in there to make sure they aren't reset (unless you really want that).
FN-GM Posted January 11, 2016 Posted January 11, 2016 Just for info, if you select them all in AD users and computers you can reset the password for all of them at the same time. Just right click and properties. There is no need to use powershell for this really. No you can't..... 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now