[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
password expiration check
Hi
i had tried to find out the list of all user's whose passwords are expired.
i had written some jndi code by finding the max age and then find out the
current time and subtracted this current time from max age using the
following code
"Attributes attbts=ctx.getAttributes("cn=pwdpolicy");
String maxAge=(String)attbts.get("pwdMaxAge").get();
Date Today = new Date();
System.out.println("maxAge"+maxAge);
long curTime=(Today.getTime())-Long.parseLong(maxAge)*1000;"
and then parse it and create a string time as follows
String time=year+month+day+hour+minute+second+"Z";
where "year" "month" etc were parsed from curTime
now i can get the list by using following code
"String filterCriteria="(&(objectclass=dci-user)(pwdChangedTime>="+time+")";
NamingEnumeration results = ctx.search(baseDN,filterCriteria, sc); "
but the current time which i am getting is the time of my system not the
time of ldap server
so my questions are following;
1.Can there is any way by which i can get the tivole sever's system time.
2.If there is no way then can you suggest any other way to find out the list
of user's whose passwords are expired.
please help me.
Thanks.
Krishan Rathi.