In Salesforce, there is an option to create local users [Setup -> Manage Users -> Users -> New User]. In addition, there is an option to map users from a domain (using Identity connect). For each user, I want to be able to determine if he was created locally or mapped from Active Directory. It will be nice if I'll get the specific domain for each domain user (in case that there are more then one domain in organization).

  1. Query User Records to Identify user type for users:

    List userList = [SELECT Id,Name,UserType FROM User limit 50000];


  1. To identify user type of a logged in user:


|improve this answer|||||

You can check the Federation Identifier field on the User Record .

The Federation ID User Field can only be accessed and edited if a user has the "Manage Users" permission granted via Profile or Permission Set. The "Manage Users" permission requires that "Reset User Passwords and Unlock Users" and "View Setup and Configuration" permissions be enabled as well.

When a user is created from AD ,I am sure you might be having an external Id field on the user record you can look for that as well.

|improve this answer|||||
  • but like you said, there is an option to edit this value. in addition, you can set the mapping to this value to null (identity connect). – user34147 Aug 1 '16 at 6:04

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.