Freezing Salesforce User Accounts & Freezing in Bulk
Have you ever wanted an easier way to 'freeze' a Salesforce User Account? (Insert your #WhySFAdminsDrink jokes here.)
There are obvious reasons you might want to lockdown a user account without deleting the account.
It could be as part of rollout or deployment — where a new set of features are being introduced to the org. Or, perhaps you may need to block users from logging into a Salesforce account because there is an active update of existing features. When a user is under internal audit or investigation, their Salesforce user account may need to be frozen.
Whatever your use case, there is an easy way to disable users from logging in without losing their account history and information — and you can even freeze Salesforce user accounts in bulk.
Freeze Feature in Salesforce
The feature is appropriately named “Freeze,” and it 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 and the Salesforce1 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.
Manage Salesforce Users with SalesforceA mobile app
Using SalesforceA, the mobile app for Salesforce administrators, you can freeze individual Salesforce user accounts.
Available for Android and Apple devices
Salesforce License Implications During User Account Freeze
It's important to note that the frozen user is still valid and active in the Salesforce org. Here’s what that means for the frozen Salesforce user account:
You can perform data migrations and assign ownership of new records to frozen user accounts.
The frozen user’s license cannot be passed on to another user while they are frozen.
The frozen user must be deactivated to successfully pass the user license to a different user.
When a Salesforce user account is frozen, you are merely stopping the user from interacting with the Salesforce org.
Deactivating Versus Freezing a Salesforce User Account
Freezing Salesforce User Accounts in Bulk
Freezing single users can be accomplished through the Salesforce user interface (UI), but freezing multiple users at one time takes a different approach.
To freeze Salesforce user accounts in bulk, follow these steps:
Vote for this idea, and then continue onto steps that will work today.
Using the Salesforce Data Loader (API version 29.0 and later), run an export from the UserLogin object. Remember to tick the Show all Salesforce Objects checkbox.
Select the ID, UserID, IsFrozen fields and export the .csv file.
In the .csv file, change the IsFrozen field to TRUE for Salesforce user accounts you’d like to freeze. Change the field to FALSE to unfreeze Salesforce user accounts.
Using Salesforce Data Loader, open the UserLogin object. Run an update using the .csv file you created.
Tips for freezing multiple Salesforce user accounts at a time
After using the method above to freeze multiple Salesforce user accounts at one time, several important lessons were learned.
Here are a few things to keep in mind:
Finding the best method to filter the query during the Export step is essential.
Using Execute Anonymous is more straightforward for developers. The control feels more granular and confident, to freeze and unfreeze users in bulk:
Simulate the experience 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 so as to not hit governor limits.
Don’t forget to copy user IDs from Script 1 before your final step of Unfreezing users.
Script Examples for Freezing Multiple Salesforce User Accounts
Other ways to freeze multiple Salesforce users at one time
Salesforce is a versatile platform offering different methods to complete similar tasks. Choose the best method for your use case and Salesforce development or administrative experience.
Aside from the method outlined above, here are some other ways to freeze multiple Salesforce users at one time:
Apex Batch Class
Write an Apex Batch class to freeze Salesforce users in bulk. Then, write an admin page in Lightning Web Components/Visualforce/Aura to manage the selecting of users/profiles.
Salesforce Lightning Flow Builder
You can build a flow with Lightning Flow Builder. Using Flow, you can freeze and unfreeze the users, and even surface drop-downs and user filters in your custom-built flow. (Test in Sandbox first!)
External Salesforce Integrations
Using an integration you may already have (like DBAmp and SQL Server perhaps) you could write procedures in your preferred external tool to get the job done.
Contact CRM Science Salesforce Consultants
The CRM Science lab coat experts know how to freeze Salesforce users using clicks or code and so much more. The team has performed enterprise level Salesforce org migrations, integrations, cleanup and more.