function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ravi_SFDCRavi_SFDC 

Regarding Permission Set

How can i know (using query) a Permission Set is not assigned to any user in the ORG

Regards
Ravi
Best Answer chosen by Ravi_SFDC
VinayVinay (Salesforce Developers) 
Have you tried running  “Salesforce Optimizer” which will give you a list of “Unassigned Permission Sets” specifically for identifying “Active Users”.

https://trailhead.salesforce.com/content/learn/modules/salesforce-optimizer/run-a-report-and-review-the-findings#:~:text=Salesforce%20Optimizer%20is%20a%20Lightning,to%20run%20the%20Salesforce%20Optimizer.

Also I dont think we can create any report of user assign to a permission set but however you can check once on this and also see if you can take backup of metadata of permission sets and users and search manually using vs code.

Please mark as Best Answer if above information was helpful.

Thanks,

All Answers

VinayVinay (Salesforce Developers) 
Hi Ravi,

Check below reference to Find Users who are not assigned to a Permission Set.

https://help.salesforce.com/s/articleView?id=000341510&type=1

Please mark as Best Answer if above information was helpful.

Thanks,
PriyaPriya (Salesforce Developers) 
Hey Ravi,

Below is the SOQL query we can create using Workbench to capture the Permission Sets associated with a given User or Profile via the Permission Set Assignment object

Qurry :-
SELECT Id, PermissionSetId, PermissionSet.Name, PermissionSet.ProfileId, PermissionSet.Profile.Name, AssigneeId, Assignee.Name FROM PermissionSetAssignment WHERE Assignee.Name = 'JOHN SMITH'

Or retrieve all users associated with a specific PermissionSet like:
SELECT Id, PermissionSetId, PermissionSet.Name, PermissionSet.ProfileId, PermissionSet.Profile.Name, AssigneeId, Assignee.Name FROM PermissionSetAssignment WHERE PermissionSet.Name = 'Custom PermissionSet Name'


Note: The above code is an example and may vary depending on the organization's customization.

If the information was helpful, Kindly mark it as the best answer.

Thanks & Regards,

Priya Ranjan

Ravi_SFDCRavi_SFDC

Hi Vinay,

Thank you for the info.

But the provided URL would get the list of Users assigned to a Permission set

MY REQUIREMENT IS as BELOW
i do have few permission sets NOT AT ALL ASSIGNED TO any one user in the ORG, how can i QUERY THEM is my request.
Thanks & Regads
Ravi

 

Ravi_SFDCRavi_SFDC
Hi Priya,

Thank you for the info. But the provided

QUERY 1 would give the list of permission sets assigned to JOHN and

QUERY 2 would give the list of users who are assigned to the permission set named

MY REQUIREMENT IS as BELOW
i do have few permission sets NOT AT ALL ASSIGNED TO any one user in the ORG, how can i QUERY THEM is my request.

Thanks & Regads
Ravi
VinayVinay (Salesforce Developers) 
Have you tried running  “Salesforce Optimizer” which will give you a list of “Unassigned Permission Sets” specifically for identifying “Active Users”.

https://trailhead.salesforce.com/content/learn/modules/salesforce-optimizer/run-a-report-and-review-the-findings#:~:text=Salesforce%20Optimizer%20is%20a%20Lightning,to%20run%20the%20Salesforce%20Optimizer.

Also I dont think we can create any report of user assign to a permission set but however you can check once on this and also see if you can take backup of metadata of permission sets and users and search manually using vs code.

Please mark as Best Answer if above information was helpful.

Thanks,
This was selected as the best answer
Ravi_SFDCRavi_SFDC

Hi Vinay,

I have taken the approach of the Salesforce Optimizer only 3 days back, for which i can get the needed info. But thank you for your valauble time.

Thanks

Ravi