Jump to content

Recommended Posts

Posted

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

Posted (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 by FN-GM
  • Thanks 1
Posted

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.

Posted
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.

  • Thanks 1
Posted

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)

Posted
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)

Posted
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).

Posted
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.....

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...