SetPassword failure on Windows Server 2012
Hello,
I am trying to figure out why the following script fails on Windows Server 2012 RC.
$Group = [ADSI]"WinNT://localhost/Administrator,user"
$Group.Invoke("SetPassword","WnSrv12**2")
The error that I get is:
Exception calling "Invoke" with "2" argument(s): "The specified network password is not correct.
The same script works on Windows Server 2008 R2.
Can someone help?
Thanks!
June 12th, 2012 4:58pm
Might ask them here.
http://social.technet.microsoft.com/Forums/en-US/winserver8gen/threads
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.
Free Windows Admin Tool Kit Click here and download it now
June 12th, 2012 10:58pm
Hi Vik,
If the account is already logged in and authenticated you can try the following syntax:
user.Invoke("SetPassword", new object[] {newPwd});
Kind Regards,
Martin
If you find my information useful, please rate it. :-)
June 12th, 2012 11:22pm
Martin, I tried your syntax and got the same error.
DirectoryEntry admin = new DirectoryEntry("WinNT://localhost/Administrator,user");
String password = "adRR32l.";
admin.Invoke("SetPassword", new object[] { password });
admin.CommitChanges();
Dave - I didn't know that there is a forum for Windows 2012. Thanks for pointing me to it.
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2012 6:06pm
Hi,
We can also seek help regarding scripts from our script forum:
http://social.technet.microsoft.com/Forums/en-US/ITCG/
Regards
KevinTechNet Community Support
June 14th, 2012 12:00am
Hi,
We can also seek help regarding scripts from our script forum:
http://social.technet.microsoft.com/Forums/en-US/ITCG/
Regards
KevinTechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
June 14th, 2012 12:15am


