Hil diegolave. Please, keep the original post language so all users can follow it.
You may change whatever you need, just edit the script and adjust your own AD settins, like this (line 16):
Code:
# Server values
LDAP_SERVER="ldap://111.1.1.150"
BASEDN="dc=example,dc=com"
BINDDN="CN=username,DC=example,DC=com"
BINDPW="secret"
FILTER="(&(sAMAccountName=*)(objectClass=user)(givenName=*))"
FIELDS="mail"
Just adjust it to fit your needs ;-)