title: LDAP get user email
body: <p>LDAP</p>
  
  <p>How can I get user email attribute from LDAP server for domain user using bash?</p>
  
  <p>I suppose that I should use ldapsearch command. </p>
  
  <p>I have the following information about ldap server:</p>
  
  <p>Server Name: server.url</p>
  
  <p>Server Port number: portnum</p>
  
  <p>Search base: dc=prefix1,dc=db</p>
  
  <p>Account name: domain\user_name</p>
  
  <p>Password: domain_password</p>