title: user account creation date in LDAP
body: <p>I would like to write a shell script to do the following , would advise how to make it ? very thanks</p>
  
  <ol>
  <li>Connect LDAP server ( Id : user , password : pass )</li>
  <li>check the field <code>user_account_create_date</code> in the LDAP server, the format of data in this field is <code>ABC20130922</code> (September 22, 2013)</li>
  <li>find the record in this field to check last 8 digits ,</li>
  </ol>
  
  <p>Pseudocode: </p>
  
  <pre><code>   if the date is within 7 days: # account is created within 7 days
         then do
              ...
         else do
              ...
  </code></pre>
  
  <p>I have a script as below which connect ldap, and check if the user account is created within 7 days ( the script is not complete yet)</p>
  
  <pre><code>timestamp = date --date="-7 days" +%Y%m%d%k%m%SZ
  
  ldapsearch -h 192.168.1.100 -p 389 -D cn=admin,o=services -w pass -x "(&amp;(objectclass=*)(createTimestamp&gt;=$timestamp))"
  
  then 
  </code></pre>
  
  <p>What I hope to do now is to modify the above script so that <code>createTimestamp</code> get the creation date string which can be used to compare with timestamp.</p>