6

As part of a task, I need to look into Salesforce to grab users and find what licenses they are using (all through SOQL so far, with Oauth authentication).

As part of my research, I looked up the UserLicense object, but the LicenseDefinitionKey field is really not that helpful (values don't reflect proper license split or names).

Is there any other object I should be looking at which may contain proper licenses? I don't think I am the only one around looking for that.

Edit from comments:

What I get from field LicenseDefinitionKey:

  • AUL: corresponds to the Salesforce Platform user license
  • AUL1: corresponds to the Salesforce Platform One user license
  • SFDC: corresponds to the Full CRM user license

What I would like to find: proper licenses as per Salesforce "Company Information":

  • Company info
  • Can you share on what difference you see? – Raul Oct 4 '17 at 20:55
  • "the LicenseDefinitionKey field is really not that helpful (values don't reflect proper license split or names)". Can you add some clarification on what you are expecting to see beyond what the LicenseDefinitionKey provides? – Daniel Ballinger Oct 4 '17 at 22:13
1

You can get the more common names to match up with the Company Information UI using SOQL.

Select Id, Name, LicenseDefinitionKey from UserLicense

UserLicense LicenseDefinitionKey field

If you want to start grouping by UserLicense type start with:

Select Id,Name, Profile.UserLicense.Name,Profile.UserLicense.Id  from User

Then start grouping by UserLicense:

Select Profile.UserLicense.Name, Count(Id)  from User group by Profile.UserLicense.Name

How can we also get a "SFDC" UserLicense breakdown like on the Company Info screen "Feature Licenses" section?

I believe these are the User.UserPermissions* fields. E.g. UserPermissionsOfflineUser is "Indicates whether the user is enabled to use Offline Edition (true) or not (false). Label is Offline User."

enter image description here

  • Thanks Daniel! Doing this map does give me the map between users and UserLicense, but how what is the mapping between LicenseDefinitionKey and "User License" found in Company Info screen? there is no 1 to 1 match between the 2 – Benjamin Soulier Oct 5 '17 at 15:17
  • How can we also get a "SFDC" UserLicense breakdown like on the Company Info screen "Feature Licenses" section? Thanks! – Benjamin Soulier Oct 5 '17 at 15:24
  • Each UserLicense has a unique LicenseDefinitionKey. Or at least that has been my finding. The Feature Licenses appear on the User with the UserPermissions* fields. – Daniel Ballinger Oct 5 '17 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.