Solved

Atrribute in AD is has a Datatype = largeinteger

Posted on 2014-01-15
7
298 Views
Last Modified: 2014-02-08
Hi experts.

I'm trying to get the atrribute "lastLogonTimestamp" and it is a date from activedirectory by using SQL syntax. The date is a largeinteger datatype.

I do not know how to get the data from AD into something useful.

I have tried to do this:

var
bigint : int64

begin
  try
    ADOQuery4.SQL.Clear;
    ADOQuery4.SQL.Text := 'SELECT operatingSystem, lastLogonTimestamp FROM '+ Quotedstr('LDAP://OU=COMPUTERS,OU='+copy(ComputerNavn,3,2)+',OU='+copy(ComputerNavn,1,2)+',OU=FIRM,DC=AD,DC=FIRM,DC=ORG') + ' WHERE cn = '+ QuotedStr(ComputerNavn);
    ADOQuery4.Open;
    bigint := ADOQuery4.FieldByName('lastLogonTimestamp').AsLargeInt;
  finally
    ADOQuery4.Close;
  end;
end;

Open in new window


but I get this error:


'Could not convert variant of type (Dispatch) into type (Boolean)'
0
Comment
Question by:QC20N
  • 4
  • 2
7 Comments
 
LVL 19

Expert Comment

by:Thommy
ID: 39781716
This previous EE question should help you...
Active Directory LastLogon attribute
0
 

Author Comment

by:QC20N
ID: 39781743
Funny that I could not find that myself, but thank you for the link.

But as it is now, I have already some SQL calls to Active Directory. I would like to keep it that way. I do not like to mix things. I do not hope that will be any problem. :)
0
 
LVL 42

Expert Comment

by:EugeneZ
ID: 39781849
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 42

Expert Comment

by:EugeneZ
ID: 39781861
you may like to use w32tm.exe /ntte

How to convert date/time attributes in Active Directory to standard time format
http://support.microsoft.com/kb/555936
0
 

Accepted Solution

by:
QC20N earned 0 total points
ID: 39781879
Hi EugeneZ.

I just found out that I already have the solution in my list of questions.

Sorry for the trouble.

I will delete the question.

http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_27231873.html
0
 

Author Comment

by:QC20N
ID: 39781895
Btw, are you from Denmark?
0
 

Author Closing Comment

by:QC20N
ID: 39843938
I had ask the question before. Forgot I had it myself.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now