Sample Code to Compute Password Expiration for Active Directory
Posted on 2002-05-07
I need to write some JNDI code that determines the date on which an Active Directory user's password will expire. If anyone could point me to an example or code snippet I would really appreciate it. In AD the pwdLastSet attribute stores the number of elapsed seconds sin Jan 1, 1970. I have written code to get the value convert it to a long and pass the value to the java.util.Date constructor. I am running into a problem when I try to multiply the value retrived from AD * 1000 to get the elapsed milliseconds. When I do the multiplication I receive a negative number. Anyway any help would be greatly appreciated.
Thanks in advance.