Salesforce has Login History for 6 months, but our requirement is for compliance to see list of Admin user who has logged in as other user by using "Login as a User" for testing i.e. Suppose Admin "A" has logged in our sandbox and for testing logs in as user "U", then I want to know the history having mapping of all Admin user along with associated user they have logged in.

Is it possible to get such data ? If so , can you guide me on how I can achieve this ?

  • (I don't actually have an answer for either scenario off the top of my head, BUT...) do you mean you want to do this off existing data: ie. You would like a way to determine the last 6 months of activity. OR do you mean you would like to develop a system that will facilitate this kind of reporting in the future?? – Simon Lawrence Jun 13 '14 at 14:53
  • I looked at existing data (CSV) file but could not find a log entry when Admin uses "Login as a User", so not sure if its possible via existing data. Also if required I can build a system which captures such logs, but I do not have any starting point or I do not know how I can infer if the user logged in is via "URL" or via "Login as a User". – user1311813 Jun 13 '14 at 15:15
  • Admins also run unit tests using "RunAs" where the User may or may not exist. Do you want to capture that information as well? Many other things will often run under an admin's credentials even though they personally are not actively involved in what's happening. Outbound mail services they've created would be one example that comes to mind which run even when they're not logged in. Am certain there are many others. – crmprogdev Jun 13 '14 at 19:34
  • Runas, however, leaves no impression on the system, because all changes made to data in a test method are rolled back, so that's not really relevant. In fact, the user from runas may have been created in the test method, and wouldn't persist beyond the test method anyways. – sfdcfox Jun 18 '14 at 13:32

You can see this data under Setup > Security Controls > View Setup Audit Trail. It doesn't appear as a login in Login History because it's not an actual login.

|improve this answer|||||
  • I logged in as User A and did one Feed Post, no entry was created in SetupAudotTrail object – Ashish Narang May 10 '16 at 11:36

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.