Need to Modify Powershell Script to Reset Passwords for Active Directory Users in Child Domain
I have pasted below a Powershell script which resets users passwords and forces to change at next logon.
The script uses a csv file for the list of users.
The script worked in the test environment but the production environment has a child domain where the scripts intended users reside.
What changes must be made in order for this script to be able to reset passwords for users in a child domain and force their password to change at next logon?
I ran both of the scripts you have listed and received the error pasted below. Thoughts?
Exception calling "FindOne" with "0" argument(s): "The (sAMAccountName=) search
filter is invalid."
At D:\power shell commands\stores\reset pw ps\PasswordReset.ps1:9 char:30
+ $Result = $Searcher.FindOne <<<< ()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Exception calling "FindOne" with "0" argument(s): "The (sAMAccountName=) search
filter is invalid."
At D:\power shell commands\stores\reset pw ps\PasswordReset.ps1:9 char:30
+ $Result = $Searcher.FindOne <<<< ()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException