本文介绍了从命令行使用ldapsearch查询Windows Active Directory服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以让我知道是否可以使用ldapsearch,ldapadd,ldapdelete等实用程序查询Active Directory服务器?

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

推荐答案

简短的回答是是".用于查询Active Directory服务器的示例ldapsearch命令是:

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

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

这将以用户[email protected]的身份连接到主机名ldapserver.mydomain.com的AD服务器,在命令行上提示输入密码,并在cn=users,dc=mydomain,dc=com子树中显示用户的名称和电子邮件详细信息.

This would connect to an AD server at hostname ldapserver.mydomain.com as user [email protected], 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.

请参见在Linux上的命令行中管理LDAP 更多样本.有关Microsoft Exchange文档,请参见 LDAP查询基础使用带有Active Directory的LDAP查询的样本.

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.

这篇关于从命令行使用ldapsearch查询Windows Active Directory服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 17:41