Page 1 of 1

Changing the password of a user via Script

Posted: Mon Jul 30, 2012 1:52 am
by filou
Hi,

I would like to know if it's possible to change the password of a User via Script instead of using the built-in function "Show Users Dialog"?

Thank you
Regards
Philippe

Re: Changing the password of a user via Script

Posted: Mon Jul 30, 2012 7:06 am
by mark.monroe
Use the below code to change the user password via a script. It will not ask for the password of the user you are changing the password for.

A_User is the user name you want to change the password for.
A_Password is the new user password.

Code: Select all

using Neo.ApplicationFramework.Common.Service;
//Use the below code to change a password. It doesn't ask you for the old password.
//It just changes it to the new one.
ISecurityServiceCF securityServiceCF = ServiceContainerCF.GetService<ISecurityServiceCF>();
securityServiceCF.ChangePassword(Globals.Tags.A_User.Value, Globals.Tags.A_Password.Value);

Re: Changing the password of a user via Script

Posted: Sun Aug 05, 2012 11:19 am
by filou
Thank you Mark Monroe !!!!