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
Phuc Nguyen 18Phuc Nguyen 18 

Count of users assigned to a profile

Hello,
Lookin gto do an audit on the number of users assigned to all of the profiles in an org.  Is there a way to get the user count on each profile? Goal is to remove/consolidate profiles if possible.
Thanks
P
Best Answer chosen by Phuc Nguyen 18
Ravi Dutt SharmaRavi Dutt Sharma
Hopefully this should help:
 
SELECT count(Id), Profile.Name FROM User GROUP BY Profile.Name
User-added image
 

All Answers

Hemant_SoniHemant_Soni
Hi,
There is no standard way to this. What you can do is you can simply create a VF page or Lightning component which will do this for you.
Your goal is not easy to achive but yes this possible.
Please let me know if need any other assistance.We can directly connect on my gmail.

Thanks
Hemant
Email : sonihemant.jaipur@gmail.com
Andrew GAndrew G
If its  a one off activity, consider
1. Exporting all (Active) users with the profile Id.
2. Exporting all profiles including Name and Id.
3.  Bash the two exports together in something like Excel.

Manual, but perhaps easier to achieve than doing a VF page with controller and queries etc for what may be a one-off activity.

Regards

Andrew G
 
Ravi Dutt SharmaRavi Dutt Sharma
Hopefully this should help:
 
SELECT count(Id), Profile.Name FROM User GROUP BY Profile.Name
User-added image
 
This was selected as the best answer
Phuc Nguyen 18Phuc Nguyen 18
Ravi,
That's perfect!
Thank you,
P
BarryBarry

Thnx!

Additional: TO filter on only active users, add 'WHERE IsActive = TRUE'. Otherwise it will include all your old inactive users.

 

SELECT count(Id), Profile.Name 
FROM User 
WHERE IsActive = TRUE
GROUP BY Profile.Name