- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2018 05:22 AM
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!
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 12:54 PM
The problem with your script is you are literally returning the string "adt" instead of the value of the variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2018 08:26 AM
What does the data look like in the import set table for the AD lastlogontime attribute?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2018 11:14 PM
Hi Jim,
Sorry for the delay in response.
The value that we are getting to the import set table is "131871081929107968"
I have tried to capture by creating a string custom field and mapped it. It's getting updated.
However, problem in converting and updating the Date custom field.
Code I have written is
var gdt = new GlideDateTime();
var mstime = (source.u_lastlogontimestamp);
gdt.setNumericValue((mstime - 116444736000000000)/10000);
gdt.getValue();
gdt.setDisplayValue(gdt.getValue());
var adt = gdt.getDisplayValue();
return "adt";
Please advise!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 12:54 PM
The problem with your script is you are literally returning the string "adt" instead of the value of the variable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 12:58 PM
Kiran,
Below is the script that I use to get last login time from AD to SN field.
Transform script onBefore
Script
// Updates the SN last logon field
var n = source.u_lastlogontimestamp;
var s = n.toString();
if (s.charAt(0) == 1) {
var dtUtil = new DateTimeUtils();
target.u_last_logon = dtUtil.int8ToGlideDateTime(n);
}else if(!target.u_lastlogontimestamp.nil()) {
target.u_last_logon = '';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2018 04:40 AM
Thanks Mike,
I tried the above and it didn't work for me.
However, I have also tried as per the Jim's advise and it worked for me.
Thank you all, for looking into this 🙂