identify Salesforce user "type"

I'm working on App that should get information about Salesforce users.

How can I check if a salesforce user was created locally or mapped from Active Directory?

Replay

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

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

System.debug('####'+userList);

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

    System.debug('##'+UserInfo.getUserType());

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.

Category: user Time: 2016-07-31 Views: 2
Tags: user

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.145 (s). 12 q(s)