I have 500 user accounts stored in a list.
I want to set thier password to a specific string. I have a code that is running fine but it generates a DML error when the list becomes larger then 150. I need to get around this error and set the passwords for all 500 users in one go. Any help will be appreciated. Thanks!!!!
I have tried this code and it works fine till user no 151.
List userList = new List();
userList = [SELECT Id from User WHERE IsActive = true ];
for(User usr : userList) {
System.setPassword(usr.Id, 'xxxxxxxx');
System.debug('DONE: ' + usr.Id);