.NET Active Directory Password Expiration on Windows 2008
        Posted  
        
            by Brent Pabst
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Brent Pabst
        
        
        
        Published on 2010-03-12T02:51:18Z
        Indexed on 
            2010/03/12
            2:57 UTC
        
        
        Read the original article
        Hit count: 519
        
Searched SO and Everywhere else, including the .net developers guide to directory services programming book - no luck.
I am trying to create a simple password reset web page that allows the user to change their password. The change password portion of the code is working fine. For the users I would also like to display when their current password will expire next.
Using the sample code from the book mentioned above I was able to get all of the code setup however, the attribute that is returned is always equal to Long.MinValue and hence cannot be inverted to a positive number, plus this means it did not find the proper domain setting.
Does anyone have sample code or references for getting the password expiration in a Windows 2008 or R2 domain environment where password policies can be different for each user?
© Stack Overflow or respective owner