Have you ever wanted an easier way to 'Freeze' a User in Salesforce? (Insert your #WhySFAdminsDrink jokes here.) There are some obvious reasons you might want to lock down a User. It could be as part of rollout or deployment, where a new set of features is being introduced to the org. Or perhaps you may need to block users from logging into Salesforce because there is an update of existing features. When a User is under internal audit or investigation, they may need to be frozen. Whatever your use case, there is a new way to do disable users from logging in, with the added advantage of being able to do it in bulk.
The feature is appropriately named “Freeze”, and is available on the User record. We’ve tested, and verified, that as soon as the user is frozen, they are kicked out of active sessions in the web browser, as well as, the Salesforce 1 mobile app. After they've been frozen, their next action in Salesforce will redirect them to the login screen. This will persist until they are released from their frozen state. It's important to note that the User is still valid and active, which means a couple things. For instance, you can perform data migrations where they are the Owner of new records. Their license can not be passed to another user while they are frozen. In order to reassign licenses, the User must be deactivated. In our case, we are merely stopping the user from interacting with the Salesforce org.
From Winter 14 release is the new feature allowing you to freeze/unfreeze a user:
Here's how you use the Salesforce Data Loader to freeze and unfreeze in bulk:
However, we found using Execute Anonymous to be more straightforward for developers. The control feels more granular and confident, to freeze and unfreeze Users in bulk:
TIP: Do this in a sandbox before trying in your production environment
Script 1 will gather any existing frozen users so you don’t accidentally “Unfreeze” them in the last step.
Script 2 does the work to freeze or unfreeze. It runs in a batch size as to not hit governor limits.
Don’t forget to copy user IDs from Script 1 before your final step of Unfreezing users.
If you would like our Lab Coats to solve your Salesforce puzzle, contact us here: