OID Properties

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dotnetpeep
    New Member
    • Nov 2007
    • 1

    #1

    OID Properties

    Hi
    I am trying to find the passwordexpirat iondate for a user. I am able to get that in active directory. The code is as follows
    using (Domain domain = Domain.GetCurre ntDomain())
    using (DirectoryEntry domainEntry = domain.GetDirec toryEntry())
    {
    long maxAge;
    IADsLargeIntege r largeIntMaxAge = domainEntry.Pro perties["MaxPwdAge"].Value as IADsLargeIntege r;
    maxAge = (((long)(largeI ntMaxAge.HighPa rt) << 32) + (long)largeIntM axAge.LowPart);

    DirectoryEntry user = new DirectoryEntry( "ladap path", null, null, AuthenticationT ypes.ServerBind );
    user = Entry;
    IADsLargeIntege r largeInt = user.Properties["pwdlastset "].Value as IADsLargeIntege r;
    long expDate = (((long)(largeI nt.HighPart) << 32) + (long)largeInt. LowPart) - maxAge;

    DateTime dt = DateTime.FromFi leTime(expDate) ;

    }

    Now I want to find the passwordexpirat iondate for user in OID. I could not find any related properties(or attributes) there. Please suggest me a way out of this

    Thanks
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    You might be able to find something useful from this article?


    I am unfamiliar with using the active directory withen .net though, so I can't help with specifics.

    Comment

    Working...