Jump to content

Recommended Posts

Posted

Hi All,

 

Would someone be so kind as to tell me how to bulk change a password for all user in a OU and also how to put the same file into multiple users home folder in the same OU. sorry this is quite basic but I want to make sure I get this right first time.

 

Cheers

Posted

Try this using Powershell

 

$Password = ConvertTo-SecureString 'Password' -AsPlainText -Force

Get-ADUser -Filter * -SearchBase "The DN of the OU in question" | Set-ADAccountPassword -NewPassword $Password -Reset:$true -Server:yourdc

 

or if you want to add the change password option.

 

$Password = ConvertTo-SecureString 'Password' -AsPlainText -Force

Get-ADUser -Filter * -SearchBase "The DN of the OU in question" | Set-ADAccountPassword -NewPassword $Password -Reset:$true -Server:yourdc -PassThru | Set-ADUser -ChangePasswordAtLogon:$true

 

Would send the other in a sec, need to sort out a call

  • Thanks 1
Posted

@amudamai sorry to be a bit numb but is there anyway of breaking that down a bit so I know what I'm entering maybe an example? its my first time doing anything like this so I'm not familiar with PowerShell

 

Cheers

Posted
@amudamai sorry to be a bit numb but is there anyway of breaking that down a bit so I know what I'm entering maybe an example? its my first time doing anything like this so I'm not familiar with PowerShell

 

Cheers

 

[color=#333333]$Password = ConvertTo-SecureString 'Password' -AsPlainText -Force
[/color]

 

Sets a variable to the password you want in a secure format that AD will accept.

 

[color=#333333]Get-ADUser -Filter * -SearchBase "The DN of the OU in question" | Set-ADAccountPassword -NewPassword $Password -Reset:$true -Server:yourdc

 

First it Gets all the users in an OU of your choice (in the format "ou=users,ou=somewhere,dc=domain,dc=local"), it then passes that information to another command to Set the password to what you specified earlier.

 

The second command he listed does the same but also specifies that all the accounts then have to change their password at login.[/color]

  • Thanks 1
Posted

So for example is this something like what I should be putting in:

 

-Filter * -SearchBase "OU=year9,OU=Students, dc=schooldomain.sch.uk dc=local" | Set-ADAccountPassword -NewPassword $Temppassword -Reset:$true -Server:ADserver1

Posted

"OU=Year9,OU=Students,DC=Schooldomain,DC=sch,DC=uk "

 

so would that change everyone's password to the same in the year 9 folder or in the students folder?

Posted

Just as halbaradkenafin said

 

What i would advise so not to make a mistake with the DN since you are not very familiar with it, is to go to the attribute editor on the OU properties page and copy the the DN value directly from it

 

if you don't see the "Attribute Editor" tab you will need to click on View on the main ADUC window and then select "Advanced Features"

 

Capture1.PNGCapture2.PNG

 

For the files just as tmcd35 i would used GP preferences.

  • Thanks 1
Posted (edited)

It would change any user object located inside the searchbase OU to the password specified on the first line

 

In this case "OU=Year9,OU=Students,DC=Schooldomain,DC=sch,D C=uk" Year 9

Edited by amudamai
  • Thanks 1
Posted
Excellent stuff the password side of things is sorted massive appreciation for that tomorrow ill be looking at the group policy preferences and no doubt have more questions :)

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