Remote Support Software

Provide instant remote support to customers and employees:

Click here for a free trial

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!

There is an amazing pack of free network admin tools. click here to download it






June 12th, 2012 1: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.

There is an amazing pack of free network admin tools. click here to download it






June 12th, 2012 7: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. :-)

There is an amazing pack of free network admin tools. click here to download it






June 12th, 2012 8: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.

Need to support users over the internet? click here try our remote control online beta






June 13th, 2012 3: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

There is an amazing pack of free network admin tools. click here to download it






June 13th, 2012 9:00pm
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

Need to support users over the internet? click here try our remote control online beta






June 13th, 2012 9:15pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics