function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
alibzafaralibzafar 

Manually Expire a password

HI, 

 

Is there any way that I can set expiration password date for any user or profile? 

 

Thanks 

Rakesh Aggarwal.ax1406Rakesh Aggarwal.ax1406

There is no option to set the Password Expiration DATE..

SabrentSabrent

Click Your Name | Setup | Security Controls | Password Policies.

 

Refer to http://login.salesforce.com/help/doc/en/admin_password.htm

alibzafaralibzafar

Thanks Rov, the minimum password expire period is 30 days, but I want to set this manually for an individual user or profile that can take effect instantly, something like 'Expire All password'  expires all users password immediately. 

 

Can we do this using through apex?

 

Thanks

SabrentSabrent

Oh!!! I don't think that can be done. Is there a particular reason why you want a user/profile password to expire instantly? You can make the user inactive if you no longer want the user to acess the system.

AdrianCCAdrianCC

Hello!

 

As @rov said you can deactivate users via api:

Deactivate Users 

You can’t delete a user in the user interface or the API. You can deactivate a user in the user interface; and you can deactivate or disable a Customer Portal or partner portal user in the user interface or the API. Because users can never be deleted, we recommend that you exercise caution when creating them.

 

 You can also reset the password through api calls:

 

Passwords 

For security reasons, you can’t query User passwords via the API or the user interface. However, the API allows you to set and “reset” User passwords using the setPassword() and resetPassword() calls. The password lockout status and the ability to reset the User locked-out status is not available via the API. You must check and reset the User password lockout status using the user interface.

 Source: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_user.htm#topic-title

 

Regards,

Adrian