Utility script that I call "rootsearch":
Code:
#!/bin/sh
/opt/zimbra/openldap/bin/ldapsearch -LLL -x -D"`/opt/zimbra/bin/zmlocalconfig -s zimbra_ldap_userdn|awk '{print $3}'`" -w"`/opt/zimbra/bin/zmlocalconfig -s zimbra_ldap_password|awk '{print $3}'`" -H `/opt/zimbra/bin/zmlocalconfig ldap_url|awk '{print $3}'` $* And then you can list usernames and other potentially useful information with
Code:
rootsearch '(zimbraLastLogonTimestamp<=20090528141404Z)' uid zimbraprefmailforwardingaddress zimbraaccountstatus uid
You can only do <= searches on timestamps. To do a > search, you need negation: (!(zimbraLastLogonTimestamp<=20090528141404Z))