cancel
Showing results for 
Search instead for 
Did you mean: 

Returning Active Directory LastLogonTimeStamp

Former Member
0 Kudos

Hi,

I am new to Crystal Reports. Previously I was using a VBScript to extract data from Active Directory, I want to automate this with Crystal Reports, because of layout options.

Within my reports I need the value "LastLogonTimeStamp". This value is a 64-bits integer as indicated by documentation written by Microsoft:

http://www.microsoft.com/technet/scriptcenter/topics/win2003/lastlogon.mspx

If I retrieve the value with a OLE DB (ADO) Microsoft Active Directory Services Interface the fields remain empty. When I click browse data the box also remains empty. I already tried converting the field to aa string value after quering it with Crystal, but no results.

Does anyone know a solution to this problem? With VBScript this problem is solved like this:

Set objUser = GetObject("LDAP://cn=Ken Myer, ou=Finance, dc=fabrikam, dc=com")
Set objLastLogon = objUser.Get("lastLogonTimestamp")

intLastLogonTime = objLastLogon.HighPart * (2^32) + objLastLogon.LowPart 
intLastLogonTime = intLastLogonTime / (60 * 10000000)
intLastLogonTime = intLastLogonTime / 1440

Wscript.Echo "Last logon time: " & intLastLogonTime + #1/1/1601#

Thank in advance for your reply.

Kind regards,

Laurens

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Crystal does not have the ability to access info from an AD server and there is a limit to 16 digits to report on.