从命令行使用ldapsearch查询Windows Active Directory服务器 [英] Querying Windows Active Directory server using ldapsearch from command line

查看:142
本文介绍了从命令行使用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 "mywindowsuser@mydomain.com" \
    -W \
    -b "cn=users,dc=mydomain,dc=com" \
    -s sub "(cn=*)" cn mail sn

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

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.

请参见在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服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆