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

查看:41
本文介绍了从命令行使用 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

这将连接到主机名 ldapserver.mydomain.com 的 AD 服务器作为用户 mywindowsuser@domain.com,在命令行提示输入密码并显示名称以及 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天全站免登陆