Jump to Navigation

296 - Salesforce.com Rest password by APEX

if you want to check the User Id and user pass their username, you can just copy
and paste statement below into Apex Code execute box:

System.setPassword([SELECT Id FROM User WHERE username='user01@mydomain.com'].Id, 'pass123');

Below sample script to set password of all active user in one go:

List<User> userList = new List<User>();
userList = [SELECT Id from User WHERE IsActive = true];
for (User u : userList)
    System.setPassword(u.Id, 'pass123');
    System.debug('DONE: ' + u.Id);





Main menu 2

Story | by Dr. Radut