thepridster Posted May 19, 2015 Posted May 19, 2015 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
amudamai Posted May 19, 2015 Posted May 19, 2015 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 1
tmcd35 Posted May 19, 2015 Posted May 19, 2015 For passwords check out Wisesofts BulkAD: Bulk AD Users For the file, I'd use Group Policy Preferences. 1
thepridster Posted May 19, 2015 Author Posted May 19, 2015 @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
halbaradkenafin Posted May 19, 2015 Posted May 19, 2015 @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] 1
thepridster Posted May 19, 2015 Author Posted May 19, 2015 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
halbaradkenafin Posted May 19, 2015 Posted May 19, 2015 Your Searchbase should be: "OU=Year9,OU=Students,DC=Schooldomain,DC=sch,DC=uk" But other than that it's fine. 1
thepridster Posted May 19, 2015 Author Posted May 19, 2015 "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?
amudamai Posted May 19, 2015 Posted May 19, 2015 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" For the files just as tmcd35 i would used GP preferences. 1
amudamai Posted May 19, 2015 Posted May 19, 2015 (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 May 19, 2015 by amudamai 1
thepridster Posted May 19, 2015 Author Posted May 19, 2015 Cheers guys I think I'm getting my head round this now will give it a go
thepridster Posted May 19, 2015 Author Posted May 19, 2015 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
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