0

I'm working on a PHP web based application which reads user information(username,office,email,telephone etc) on Novel Console One via Ldap search. i now need it to show when will the password expire for each user search. Your assistance is highly appriciated.

Decoy
  • 1
  • 2
  • http://blog.dave.vc/2008/09/ad-password-expiration-email.html – Daryl Gill Aug 12 '13 at 13:45
  • Thank You Daryl. I once check that post but cant figure out how the $data["pwdlastset"][0] came about. meaning where was the $data variable declared. i am still new in here. Thank you – Decoy Aug 13 '13 at 13:02

1 Answers1

0

FINALLY GOT IT!!

$ds=ldap_connect("..*.*"); // must be a valid LDAP server! $person= "username";

$dn = "o=DOMAIN"; $filter="(|(sn=$person)(givenname=$person)(telephonenumber=*$person) (cn=$person))"; $justthese = array("ou", "sn", "givenname", "mail", "cn", "fullname", "telephonenumber", "title", "initials", "l", "manager");

$sr=ldap_search($ds, $dn, $filter, $justthese); $info = ldap_get_entries($ds, $sr);

$dn2=$info[0]["dn"]; $attributes = array();

$result = ldap_search($ds, $dn2, $filter, $attributes) or die("Search failed!");

$entries = ldap_get_entries($ds, $result);

echo $entries[0]['passwordexpirationtime'][0]."
";//PASS EXPIERY DATE

Decoy
  • 1
  • 2