active-directory - 从命令行使用 ldapsearch 查询 Windows Active Directory 服务器

标签 active-directory ldap openldap

谁能告诉我是否可以使用 ldapsearch、ldapadd、ldapdelete 等实用程序查询 Active Directory 服务器?

最佳答案

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

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

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

参见Managing LDAP from the Command Line on Linux获取更多 sample 。请参阅LDAP Query Basics有关使用 LDAP 查询和 Active Directory 的示例的 Microsoft Exchange 文档。

关于active-directory - 从命令行使用 ldapsearch 查询 Windows Active Directory 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22224465/

相关文章:

datetime - Coldfusion 计算帐户过期

docker - 在Windows容器中安装Active Directory或Ldap服务器

active-directory - 如何使用筛选器避免Active Directory中的子OU?

c# - 如何使用 C# 在 Active Directory 中更改电话号码

.net - 在 Windows 8 上用于开发目的的 LDAP 服务器

java - 使用 Windows 上的登录用户在 Java 中查询 Active Directory

linux - 连接到 ldap 时出现绑定(bind)错误

ruby - ldap访问权限不足

ubuntu - Ubuntu 上的 LDAP 服务器安装问题

c - 尝试将 openldap 移植到 Windows 时出现错误 LNK2019 无法解释