I am looking for soql which could fetch me all the license used for all inactive and active users in one shot. similar to displaying company license information in native SFDC environment.

I am working on displaying the license information on VF such that i can have my own custom activation and deactivation of users in organization.

Any light on this is greatly appreciated.

2 Answers 2

select count(id), profile.usertype, isactive 
from user 
group by profile.usertype, isactive 
order by profile.usertype, isactive

Look here for a breakdown of how to interpret the different user types: What are the possible options for UserType?


force query select id, name, isactive, profile.userlicense.name from user

Will give you the users and their license type.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .