We have a batch apex class that resets passwords for community users created by another process. One of our user requirements is to store the initial password in a custom field.
The user will get the password and she can then proceed to change this when she wants it.
System.resetPassword(userId); works well for us.
Unfortunately this doesn't work well with bulkification if we have to do more than 150 users at a time.
So how do you reset the passwords, store the password and also bulkify the code at the same time?