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
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. :-)
Free Windows Admin Tool Kit Click here and download it now
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.
June 13th, 2012 5:52pm