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
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
Comment