top of page

The Easiest Way to Clean Up Inactive Users in Salesforce

  • Writer: Joshua Dehkordi
    Joshua Dehkordi
  • Jul 1
  • 2 min read

Updated: Jul 1



If you’ve been an admin for more than five minutes, you know this pain:People leave the company or change roles, but their footprint in Salesforce never quite disappears.


Even after deactivating a user, they can still linger in:


  • Permission sets

  • Queues

  • Approval processes

  • Public groups

  • Email alerts

  • Sharing rules

Over time, that clutter builds up — and it creates confusion, slows down audits, and can even introduce security risks.


This week, I focused on cleaning up inactive users assigned to permission sets — a simple win that can make a big impact.



🔍 Step 1: Find the Inactive Users


First, I wanted to see exactly who was still assigned to permission sets even though their user accounts were inactive.


Here’s the SOQL query I ran in Salesforce Inspector:


SELECT Id, AssigneeId, Assignee.Name, PermissionSet.Name
FROM PermissionSetAssignment
WHERE Assignee.IsActive = false
AND PermissionSet.Type != 'Profile'
ORDER BY Assignee.Name ASC NULLS LAST

This gave me a clean list of all inactive users and the permission sets they were still assigned to.



📋 Step 2: Review the Results


Before I went on a mass-deleting spree, I made sure to review the list with our team.

Why? Because just because a user is inactive doesn’t mean their setup is irrelevant. Sometimes:

  • The user might be temporarily deactivated

  • Their setup is used as a template for onboarding

  • Their permission assignments are being used in testing or sandbox templates


I exported the results to a spreadsheet, cleaned it up, and shared it with everyone from the team to make sure I did not undo anyone's hard work.



🧼 Step 3: Remove the Assignments


Once I got the green light, I used Salesforce Inspector again to delete the Permission Set Assignments in bulk.


Here’s how I did it:

  1. In Salesforce Inspector, go to Data Import.

  2. Change the Action to Delete.

  3. Select PermissionSetAssignment as the object.

  4. Copy and paste the 'Id' values.

  5. Execute the delete — and just like that, the permissions were gone.


Note: If you prefer Data Loader or Workbench, that works just as well — same process, just different tools with a slightly different steps.



Why This Cleanup Matters


Removing stale permission assignments might not feel exciting, but it matters more than you think:


  • It tightens your org’s security by ensuring only active users have access

  • It simplifies audits and user access reviews

  • It reduces clutter, making it easier to see who really has what access

  • It builds better admin habits around regular maintenance


Think of it as brushing your teeth — it’s not glamorous, but skipping it leads to problems down the line.



Final Thought


Cleaning up inactive users takes less than 30 minutes, but it pays off in clarity, control, and confidence. If you’ve never done it before, this is a great admin task to tackle during downtime, or add to your quarterly maintenance checklist. Small tasks like this are what help keep your org fast, secure, and future-proof.


Have a tip of your own for managing inactive users? Let me know — I’m always looking to learn smarter ways to clean house in Salesforce.

bottom of page