Activity Forums Salesforce® Discussions Is there anyway to reset password for multiple users from apex in Salesforce?

  • Manpreet

    Member
    April 21, 2017 at 1:20 pm

    Hi saurabh,

    You can try this Sample code:

    List<User> u = new List<User>();
    List<Id> ids = new List<Id>();
    String test = 'test';
    u = Database.Query('SELECT Id, Name FROM User WHERE Name =: test');
    System.debug('User details are ' + u);
    for(User usr : u)
    {
    System.resetPassword(usr.Id,true);
    }

     

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos