Querying Windows Active Directory server using lda

2019-03-07 21:27发布

Can anyone let me know if querying Active Directory server using ldapsearch, ldapadd, ldapdelete, etc. utilities is possible or not?

3条回答
姐就是有狂的资本
2楼-- · 2019-03-07 21:34

The short answer is "yes". A sample ldapsearch command to query an Active Directory server is:

ldapsearch \
    -x -h ldapserver.mydomain.com \
    -D "mywindowsuser@mydomain.com" \
    -W \
    -b "cn=users,dc=mydomain,dc=com" \
    -s sub "(cn=*)" cn mail sn

This would connect to an AD server at hostname ldapserver.mydomain.com as user mywindowsuser@domain.com, prompt for the password on the command line and show name and email details for users in the cn=users,dc=mydomain,dc=com subtree.

See Managing LDAP from the Command Line on Linux for more samples. See LDAP Query Basics for Microsoft Exchange documentation for samples using LDAP queries with Active Directory.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-03-07 21:35

You could query an LDAP server from the command line with ldap-utils: ldapsearch, ldapadd, ldapmodify

查看更多
乱世女痞
4楼-- · 2019-03-07 21:57

Yes we can query active directory using ldap utilities. Also we can query AD using java api's jndi as well.

查看更多
登录 后发表回答