#OU User Password Reset

function reset-password {

$pws = @("Student17")
get-aduser -filter \* -replacebase "OU=Year 19,OU=Students,OU=End Users,OU=FIM Managed Users,DC=DOMAINNAME,DC=local" -properties DisplayName  |  %{
 $newpw = get-random $pws
 $user = $\_.name
$DisName = $\_.DisplayName
 Set-ADAccountPassword -Reset -Identity $user -NewPassword $(convertto-securestring -asplaintext -force $newpw)
 "$user,$newpw,$DisName"
} }
reset-password add-content Year10.txt