Hi
I am trying to find the passwordexpirationdate for a user. I am able to get that in active directory. The code is as follows
using (Domain domain = Domain.GetCurrentDomain())
using (DirectoryEntry domainEntry = domain.GetDirectoryEntry())
{
long maxAge;
IADsLargeInteger largeIntMaxAge = domainEntry.Properties["MaxPwdAge"].Value as IADsLargeInteger;
maxAge = (((long)(largeIntMaxAge.HighPart) << 32) + (long)largeIntMaxAge.LowPart);
DirectoryEntry user = new DirectoryEntry("ladap path", null, null, AuthenticationTypes.ServerBind);
user = Entry;
IADsLargeInteger largeInt = user.Properties["pwdlastset"].Value as IADsLargeInteger;
long expDate = (((long)(largeInt.HighPart) << 32) + (long)largeInt.LowPart) - maxAge;
DateTime dt = DateTime.FromFileTime(expDate);
}
Now I want to find the passwordexpirationdate for user in OID. I could not find any related properties(or attributes) there. Please suggest me a way out of this
Thanks