How do you get the recent list of Impersonations attempts for a user?

heather_mcmanig
Kilo Contributor

I'm recreating the impersonate modal in a portal page menu and have it nearly finished. I still need the list of recent impersonations that the user has recently attempted. Is there any way to access this data?

Thanks!

9 REPLIES 9

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

Impersonations are stored in the Event Log (sysevent) table.   This table is rotated so the data doesn't stay around for more than a week or so.   An event is logged at the start and end of the impersonation with Parm1 being the user id that starts the impersonation and Parm2 being the user id of the person they are impersonating.   The event names are:


impersonation.start


impersonation.end




If you need this data to hang around longer, you could create a custom table and use a Script Action to populate this table as these events are logged.


Rama Chandra D
Kilo Guru

Hi Heather,



Navigate to System Logs >Events, you should see events impersonation.start and impersonation.end events. The event parameters contain the impersonated user ID.


Event param 1 should be the current user and Event param 2 should be the impersonated user ID.



Regards,


Darshak


Hi Darshak,



Is there an aPI call I can make to get that data like:


/api/now/ect..?


Hi Heather,



Not something I'm aware of. Can you detail me a bit on the purpose of the list you need?



Regards,


Darshak