Last login time is not captured in the LDAP integration

Kiran66
Kilo Contributor

I have added the last login time attribute to the user form and mapped to the AD filed attribute in the import user table.

However, when we ran the LDAP integration, last login time is not capturing from the AD. For few users it is capturing the system generated time stamp. Could anyone suggest us how to capture the last login time stamp from the AD?

Thank you!

1 ACCEPTED SOLUTION

The problem with your script is you are literally returning the string "adt" instead of the value of the variable.

View solution in original post

15 REPLIES 15

Sorry to step on Chuck's toes, but the "last_login_time" field is populated by a Script Action called "Last login time".  It keeps that field updated with the last time the user logs into the ServiceNow platform.  If you want to keep track of the last time they logged into AD, I would suggest you create a custom date/time field for that purpose specifically.

I have created a custom date/field and mapped to the AD field name in the Data sources. Still not able to get the date and time information. I have also tried the source code 

var Llogin = source.u_lastlogontimestamp;

return "Llogin";

Could you please advise how we can capture the AD last login?

 

Thank you!

If you have your variable Llogin in quotes when attempting to return the value, you are actually returning the string "Llogin" and NOT the value of the variable.

Jim Coyne
Kilo Patron

Did you find a solution to your issue?  If yes, please remember to tag the correct answer and any that were helpful.

Hello Jim,

 

We created a custom field and mapped to the lastlogontime on AD. We are getting the value now and the format is different.

We need to convert the format to our ServiceNow format to get inserted into our target field.

Thank you!