Salesforce provides an app you can install from AppExchange Lightning Adoption Tracker, but one of the criteria of this app, that you must enable My Domain.
Once this app installed, you will find a few reports and dashboards added, and a reporting snapshot that needs to be configured, for detail of the steps, see this guide.
Additionally, there are 2 fields added into User object:
“Can Use Lightning”: this custom field stores whether the user has the user permission enabled.
“Using Lightning”: this custom field stores the user preference value.
Can Use Lightning determines how many users have the permission to switch to Lightning, but if you would like to query without installing the package, get it from PermissionSetAssignment object.
SELECT Id, AssigneeId, Assignee.UserName, PermissionSetId, PermissionSet.Name, PermissionSet.IsOwnedByProfile FROM PermissionSetAssignment WHERE PermissionSet.PermissionsLightningExperienceUser = True ORDER BY Assignee.UserName
You need to get unique AssigneeId as this query may report duplicate if the user has more than 1 record permission to enable Lightning. Check this blog Using Permission Set to Query User Permission to learn more about the query on Permission Set.
Using Lightning determines users have switched to Lightning Experience, here is the query from User object without need to install the package
SELECT Id, IsActive, ltnadptn__Can_Use_Lightning__c, ltnadptn__Using_Lightning__c, UserPreferencesLightningExperiencePreferred, Username FROM User ORDER BY Username
Two fields start with ltnadptn__ are part of Lightning Adoption Tracker packaged installation. Ideally, ltnadptn__Using_Lightning__c and UserPreferencesLightningExperiencePreferred should be the same value, but as ltnadptn__Using_Lightning__c is populated hourly by apex schedule job, so you may see them in sync after an hour.
- Lightning Adoption Tracker: Reports and Dashboard
- Manage Your Rollout with the Lightning Adoption Tracker App
- The 3 Major Phases of Your Lightning Rollout
- Using Permission Set to Query User Permission
- User SOAP API Developer Guide