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
Changing the password of a user via Script
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: Changing the password of a user via Script
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.
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);
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Re: Changing the password of a user via Script
Thank you Mark Monroe !!!!