Linux.com

Home Learn Linux Linux Answers Retrieve EMail address from Active Directory in a bash script
Answers
  • Forgot to mention a thing:
    I've tried to get some info from AD with PHP and I can, is there a way to get something without installing the whole php-cli and libs ?

    Thanks
    Ben

    Answered by ben
    5 years ago
    0 0
  • Forgot to mention a thing:
    I've tried to get some info from AD with PHP and I can, is there a way to get something without installing the whole php-cli and libs ?

    Thanks
    Ben

    Answered by ben
    5 years ago
    0 0
  • Forgot to mention a thing:
    I've tried to get some info from AD with PHP and I can, is there a way to get something without installing the whole php-cli and libs ?

    Thanks
    Ben

    Answered by ben
    5 years ago
    0 0
  • found a link explaining capabilities of ldap-search package and various utilities but i think it's too limited, in my case I need to retrieve email address as well as other information from AD Tree, just solved using PHP. Of course Python and other folks can do the same as well

    Answered by ben
    5 years ago
    0 0
  • found a link explaining capabilities of ldap-search package and various utilities but i think it's too limited, in my case I need to retrieve email address as well as other information from AD Tree, just solved using PHP. Of course Python and other folks can do the same as well

    Answered by ben
    5 years ago
    0 0
  • found a link explaining capabilities of ldap-search package and various utilities but i think it's too limited, in my case I need to retrieve email address as well as other information from AD Tree, just solved using PHP. Of course Python and other folks can do the same as well

    Answered by ben
    5 years ago
    0 0
  • Using the ldapsearch tool is a quick and easy way to pull information from AD.

    the following command (substitute your directory info) can easily pull an email address from AD

    ldapsearch -x -h -s sub -b dc=,dc=COM -D "CN=your id,DC=,DC=COM" -W '(&(objectclass=User)(givenName=firstname)(sn=lastname))' mail

    wrapping the above in a shell script is trivial. use the command above and leave off 'mail' at the end. it should bring up all attributes that you can see.

    Answered by JesseBookJr
    5 years ago
    0 1
  • Using the ldapsearch tool is a quick and easy way to pull information from AD.

    the following command (substitute your directory info) can easily pull an email address from AD

    ldapsearch -x -h -s sub -b dc=,dc=COM -D "CN=your id,DC=,DC=COM" -W '(&(objectclass=User)(givenName=firstname)(sn=lastname))' mail

    wrapping the above in a shell script is trivial. use the command above and leave off 'mail' at the end. it should bring up all attributes that you can see.

    Answered by JesseBookJr
    5 years ago
    0 1
  • Using the ldapsearch tool is a quick and easy way to pull information from AD.

    the following command (substitute your directory info) can easily pull an email address from AD

    ldapsearch -x -h -s sub -b dc=,dc=COM -D "CN=your id,DC=,DC=COM" -W '(&(objectclass=User)(givenName=firstname)(sn=lastname))' mail

    wrapping the above in a shell script is trivial. use the command above and leave off 'mail' at the end. it should bring up all attributes that you can see.

    Answered by JesseBookJr
    5 years ago
    0 1
  • I've now solved with PHP but Jesse solution is what I was looking for, nice trick :-)

    Answered by ben
    5 years ago
    0 0
  • I've now solved with PHP but Jesse solution is what I was looking for, nice trick :-)

    Answered by ben
    5 years ago
    0 0
  • I've now solved with PHP but Jesse solution is what I was looking for, nice trick :-)

    Answered by ben
    5 years ago
    0 0
Please register/login to answer this question. Click here to login
Similar Questions Found
Questions from category Root

Upcoming Linux Foundation Courses

  1. LFD331 Developing Linux Device Drivers
    25 Aug » 29 Aug - Virtual
    Details
  2. LFS422 High Availability Linux Architecture
    08 Sep » 11 Sep - Raleigh, NC
    Details
  3. LFS426 Linux Performance Tuning
    08 Sep » 11 Sep - New York
    Details

View All Upcoming Courses

Community Answers - Search


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board