Arild Bakken wrote:
[color=blue]
> The LastLogon property in ActiveDirectory is a large integer. You need to
> reference the ActiveDS.dll COM library and use the LargeInteger interface to
> get the high and low parts of the 64 bit integer that it is. The value is a
> FileTime value which you can then convert to a .NET DateTime object.
>
> Btw: Note that this is no non-replicated property so that the value you get
> is the lastLogon handled by that specific domain controller. To get the
> actual Lastlogon you would need to query the value from all
> domaincontrollers in the domain and use the highest value.
>
> Arild
>
> "Sargas Atum" <atum@gmx.net> wrote in message
> news:4007efc2$1@news.piro.net...
>[color=green]
>>Hi all,
>>
>>I am trying to get the field "lastLogon" out of ActiveDirectory.
>>It should be trivial I thought, but it is not, as I have experienced.
>>
>>private DataRow FillDataRow( DataRow dataRow, PropertyValueCollection
>>property , string columnName )
>>{
>>
>>if( columnName.Equals("Last Login") && property.Value != null )
>>{
>>dataRow[columnName] = property[0];
>>}
>>
>>}
>>
>>I dont have any problems to get all string data from
>>PropertyValueCollection.
>>
>>But how do I convert property[0] to DateTime. ( Type of the Object is
>>System.__ComObject ) thats at least what I know about.
>>
>>I dont find any example on the net.
>>
>>thx
>>a.s.
>>[/color]
>
>
>[/color]
Do you have any example how to do it in c#? I found only some examples
in VB, though modified they dont work.
thx
a.s.