Home All Groups Group Topic Archive Search About

System.DirectoryServices

Author
21 Jul 2006 6:38 AM
Trevor Lawrence
Having connected to a domain object, I want to read the minPwdAge and
maxPwdAge properties.  These, however, are of type "Large Integer/Interval"
and there doesn't seem to be marsalling support for these.  They come across
as System.__ComObject, and I can't do much with that.

Any ideas how I can get the data?

Trevor

Author
22 Jul 2006 3:52 AM
Luc E. Mistiaen
Something like:

    public static long FromLargeInteger (DirectoryEntry Entry, string
LargeAttribName)
    {
      ActiveDs.LargeInteger Work = (ActiveDs.LargeInteger)
Entry.Properties[LargeAttribName].Value ;
      return (((long) Work.HighPart) << 32) | (Work.LowPart & 0xFFFFFFFF) ;
    }


/LM


Show quote
"Trevor Lawrence" <Trevor.Lawre***@kaz-group.com> wrote in message
news:ubFtjAJrGHA.4812@TK2MSFTNGP04.phx.gbl...
> Having connected to a domain object, I want to read the minPwdAge and
> maxPwdAge properties.  These, however, are of type "Large
> Integer/Interval" and there doesn't seem to be marsalling support for
> these.  They come across as System.__ComObject, and I can't do much with
> that.
>
> Any ideas how I can get the data?
>
> Trevor
>
Author
24 Jul 2006 5:23 AM
Trevor Lawrence
Thanks.  Works fine.

(I was close.  Was fiddling with ActiveDS._LARGE_INTEGER.Quadpart but that
didn't get me there.)

Trevor

Show quote
"Luc E. Mistiaen" <luc.mistiaen@advalvas.be.no.spam> wrote in message
news:e4lq%23IUrGHA.4820@TK2MSFTNGP04.phx.gbl...
> Something like:
>
>    public static long FromLargeInteger (DirectoryEntry Entry, string
> LargeAttribName)
>    {
>      ActiveDs.LargeInteger Work = (ActiveDs.LargeInteger)
> Entry.Properties[LargeAttribName].Value ;
>      return (((long) Work.HighPart) << 32) | (Work.LowPart & 0xFFFFFFFF) ;
>    }
>
>
> /LM
>
>
> "Trevor Lawrence" <Trevor.Lawre***@kaz-group.com> wrote in message
> news:ubFtjAJrGHA.4812@TK2MSFTNGP04.phx.gbl...
>> Having connected to a domain object, I want to read the minPwdAge and
>> maxPwdAge properties.  These, however, are of type "Large
>> Integer/Interval" and there doesn't seem to be marsalling support for
>> these.  They come across as System.__ComObject, and I can't do much with
>> that.
>>
>> Any ideas how I can get the data?
>>
>> Trevor
>>
>
>
Author
24 Jul 2006 4:48 AM
Marc Scheuner
>Having connected to a domain object, I want to read the minPwdAge and
>maxPwdAge properties.  These, however, are of type "Large Integer/Interval"
>and there doesn't seem to be marsalling support for these. 

Hi Trevor,

A good place to go look for answers for these kind of questions is the
System.DirectoryServices portal on MSDN:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sds/sds/portal.asp

There's a Quick List for C# Code Examples under the "Using
System.DirectoryServices" node, which contains lots of code snippets
for common operations.

One of them is called "Large Integer Property Type" and gives you an
explanation and code sample as to how to access (read) and set (write)
a Large Integer property in AD.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sds/sds/large_integer_property_type.asp

HTH
Marc

AddThis Social Bookmark Button