Knowledgebase
Knowledgebase
Powershell - Reset all user passwords in a specific OU
Posted by Jonathan Ugolick on 07 December 2019 01:05 PM

import-module ActiveDirectory

#OU location
$OU = "OU=Users,OU=Users,DC=domain,DC=local"
#New password
$Newpassword = "P455w0rd"

$Users = Get-ADuser -Filter * -SearchBase $OU

foreach ($User in $Users)
{
Set-ADAccountPassword -Identity $User -NewPassword (ConvertTo-SecureString -AsPlainText $Newpassword -Force)
}


Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).