<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Last login time is not captured in the LDAP integration in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881119#M538045</link>
    <description>&lt;P&gt;What does the data look like in the import set table for the AD lastlogontime attribute?&lt;/P&gt;</description>
    <pubDate>Wed, 14 Nov 2018 16:26:29 GMT</pubDate>
    <dc:creator>Jim Coyne</dc:creator>
    <dc:date>2018-11-14T16:26:29Z</dc:date>
    <item>
      <title>Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881109#M538035</link>
      <description>&lt;P&gt;I have added the last login time attribute to the user form and mapped to the AD filed attribute in the import user table.&lt;/P&gt;
&lt;P&gt;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?&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 12:22:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881109#M538035</guid>
      <dc:creator>Kiran66</dc:creator>
      <dc:date>2018-10-23T12:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881110#M538036</link>
      <description>&lt;P&gt;Can you provide additional details on how you are doing your LDAP integration? Specifically, your transform map and transform script(s)?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 12:24:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881110#M538036</guid>
      <dc:creator>Chuck Tomasi</dc:creator>
      <dc:date>2018-10-23T12:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881111#M538037</link>
      <description>&lt;P&gt;We have mapped the Source LDAP import table to the sys_user table and mapped the attributes in the transform map.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 12:40:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881111#M538037</guid>
      <dc:creator>Kiran66</dc:creator>
      <dc:date>2018-10-23T12:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881112#M538038</link>
      <description>&lt;P&gt;Thank you. Specifically, what has been mapped to what?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 12:56:08 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881112#M538038</guid>
      <dc:creator>Chuck Tomasi</dc:creator>
      <dc:date>2018-10-23T12:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881113#M538039</link>
      <description>&lt;P&gt;Thanks Thomas for your quick responses.&lt;/P&gt;
&lt;P&gt;We only have the issue with the last login filed value as it's not being updated when we ran the LDAP.&lt;/P&gt;
&lt;P&gt;We have mapped&amp;nbsp;u_lastlogontimestamp field from the AD to&amp;nbsp;last_login_time in ServiceNow.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 13:57:42 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881113#M538039</guid>
      <dc:creator>Kiran66</dc:creator>
      <dc:date>2018-10-23T13:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881114#M538040</link>
      <description>&lt;P&gt;Sorry to step on Chuck's toes, but the "last_login_time" field is populated by a Script Action called "Last login time".&amp;nbsp; It keeps that field updated with the last time the user logs into the ServiceNow platform.&amp;nbsp; 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&amp;nbsp;purpose specifically.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 14:18:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881114#M538040</guid>
      <dc:creator>Jim Coyne</dc:creator>
      <dc:date>2018-10-23T14:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881115#M538041</link>
      <description>&lt;P&gt;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&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var Llogin = source.u_lastlogontimestamp;&lt;BR /&gt; &lt;BR /&gt; return "Llogin";&lt;/P&gt;
&lt;P&gt;Could you please advise how we can capture the AD last login?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 15:31:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881115#M538041</guid>
      <dc:creator>Kiran66</dc:creator>
      <dc:date>2018-10-25T15:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881116#M538042</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 15:52:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881116#M538042</guid>
      <dc:creator>Jim Coyne</dc:creator>
      <dc:date>2018-10-25T15:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881117#M538043</link>
      <description>&lt;P&gt;Did you find a solution to your issue?&amp;nbsp; If yes, please remember to tag the correct answer and any that were helpful.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 07:02:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881117#M538043</guid>
      <dc:creator>Jim Coyne</dc:creator>
      <dc:date>2018-11-06T07:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881118#M538044</link>
      <description>&lt;P&gt;Hello Jim,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We created a custom field and mapped to the lastlogontime on AD. We are getting the value now and the format is different.&lt;/P&gt;
&lt;P&gt;We need to convert the format to our ServiceNow format to get inserted into our target field.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 07:30:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881118#M538044</guid>
      <dc:creator>Kiran66</dc:creator>
      <dc:date>2018-11-14T07:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881119#M538045</link>
      <description>&lt;P&gt;What does the data look like in the import set table for the AD lastlogontime attribute?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 16:26:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881119#M538045</guid>
      <dc:creator>Jim Coyne</dc:creator>
      <dc:date>2018-11-14T16:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881120#M538046</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;
&lt;P&gt;Sorry for the delay in response.&lt;/P&gt;
&lt;P&gt;The value that we are getting to the import set table is "131871081929107968"&lt;/P&gt;
&lt;P&gt;I have tried to capture by creating a string custom field and mapped it. It's getting updated.&lt;/P&gt;
&lt;P&gt;However, problem in converting and updating the Date custom field.&lt;/P&gt;
&lt;P&gt;Code I have written is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var gdt = new GlideDateTime();&lt;BR /&gt;var mstime = (source.u_lastlogontimestamp);&lt;BR /&gt;gdt.setNumericValue((mstime - 116444736000000000)/10000);&lt;BR /&gt;gdt.getValue();&lt;BR /&gt;gdt.setDisplayValue(gdt.getValue());&lt;BR /&gt;var adt = gdt.getDisplayValue();&lt;BR /&gt;return "adt";&lt;/P&gt;
&lt;P&gt;Please advise!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 07:14:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881120#M538046</guid>
      <dc:creator>Kiran66</dc:creator>
      <dc:date>2018-11-28T07:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881121#M538047</link>
      <description>&lt;P&gt;The problem with your script is you are literally returning the string "adt" instead of the value of the variable.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 20:54:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881121#M538047</guid>
      <dc:creator>Jim Coyne</dc:creator>
      <dc:date>2018-11-29T20:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881122#M538048</link>
      <description>&lt;P&gt;Kiran,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Below is the script that I use to get last login time from AD to SN field.&lt;/P&gt;
&lt;P&gt;Transform script onBefore&lt;/P&gt;
&lt;P&gt;Script&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;// 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 = '';  
}  &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Nov 2018 20:58:05 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881122#M538048</guid>
      <dc:creator>Mike Patel</dc:creator>
      <dc:date>2018-11-29T20:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881123#M538049</link>
      <description>&lt;P&gt;Thanks Mike,&lt;/P&gt;
&lt;P&gt;I tried the above and it didn't work for me.&lt;/P&gt;
&lt;P&gt;However, I have also tried as per the Jim's advise and it worked for me.&lt;/P&gt;
&lt;P&gt;Thank you all, for looking into this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 12:40:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881123#M538049</guid>
      <dc:creator>Kiran66</dc:creator>
      <dc:date>2018-12-03T12:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Last login time is not captured in the LDAP integration</title>
      <link>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881124#M538050</link>
      <description>&lt;P&gt;Kiran - can you share the snapshot of where did you put this script?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 13:27:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/last-login-time-is-not-captured-in-the-ldap-integration/m-p/1881124#M538050</guid>
      <dc:creator>Sanbir Singh1</dc:creator>
      <dc:date>2020-07-08T13:27:22Z</dc:date>
    </item>
  </channel>
</rss>

