Ads

Friday, 3 May 2013

How to reset password for particular users in Salesforce using Apex?

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);
}

No comments:

Post a Comment