Freezing Salesforce User Accounts & Freezing in Bulk

June 12, 2020

 

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. 

  • Free application

  • 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:

  1. Vote for this idea, and then continue onto steps that will work today.

  2. 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. 

  3. Select the ID, UserID, IsFrozen fields and export the .csv file.

  4. 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.

  5. 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

 

Script 1

Click for script example 

 

Script 2

Click for script example

 

 

 

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.

 

 

 

Mike Katulka

Technical Architect

CRM Science

 

 

 

Contact the lab coat experts

 

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.

 

At CRM Science, we use our Salesforce expertise to transform your enterprise. Partnering with our clients throughout the Salesforce journey, we strategize and optimize business processes, and develop solutions across every Salesforce cloud. CRM Science is an award-winning Salesforce Silver Consulting Partner and a Salesforce.org Registered Partner

 

Contact us to chat about your Salesforce projects.

 

 

Please reload

Recent Posts
Please reload

At CRM Science, we use our Salesforce expertise to transform your enterprise. Partnering with our clients throughout the Salesforce journey, we work with leaders to strategize and optimize business processes, and design and develop solutions across every Salesforce cloud. We empower companies to innovate faster, better engage with customers, and improve bottom lines. 

CRM Science is a Salesforce Silver Consulting Partner and a Salesforce.org Registered Partner. Our strategic consulting services were recognized by Salesforce in four consecutive Salesforce Partner Innovation Awards, an annual recognition for partners that deliver outstanding client success. 

Helpful Content
Blog
Events
Client Success
Connect with us
Email Us
860 First Ave, Suite 2
King of Prussia, PA 19406
(484) 775-0333
  • Twitter
  • Facebook
  • YouTube

Copyright © 2011-2020 CRM Science, Inc. All rights reserved.