Solved

Atrribute in AD is has a Datatype = largeinteger

Posted on 2014-01-15
7
303 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

810 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