博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux下LDAPSearch的例子
阅读量:6786 次
发布时间:2019-06-26

本文共 1256 字,大约阅读时间需要 4 分钟。

apt-get install ldap-utils

LdapSearch examples

The following examples are taking from various ldapsearch queries on Small Business Server 2003.

Get a user from Active Directory

ldapsearch -x -LLL -D 'CN=Administrator,CN=Users,DC=Domain,DC=local' -W -H ldap://ad.example.com:389 -b 'OU=SBSUsers,OU=Users,OU=MyBusiness,DC=Domain,DC=local' -s sub '(sAMAccountName=jean-kevin)'

the “-x” switch enables simple authentication, instead of SASL

-LLL is just a display switch, to get LDIF information only, without comments
-D is the DN of the user used to bind to the LDAP server, -W will prompt for password on the command line
-H is the address of the LDAP server
-b is the base of the search (where it will start), can be anywhere in the tree. Lower is better to filter the search.
-s sub indicates we want to search in the leaves
the last parameter is the filter in ldap filter format
Get the security groups a user is a member of

ldapsearch -x -LLL -D 'CN=Administrator,CN=Users,DC=Domain,DC=local' -W -H ldap://ad.example.com:389 -b 'OU=Security Groups,OU=MyBusiness,DC=Domain,DC=local' -s sub '(&(objectClass=group)(member=CN=Jean-Kevin De La Motte,OU=SBSUsers,OU=Users,OU=MyBusiness,DC=Domain,DC=local))'

转载于:https://www.cnblogs.com/IvanChen/p/4661217.html

你可能感兴趣的文章
机器学习导图系列(3):过程
查看>>
JSON
查看>>
js——BOM
查看>>
常用的加密与解密类
查看>>
hrbeu 哈工程 Eular Graph
查看>>
web crawling(plus6) pic mining
查看>>
sintimental analysis
查看>>
打印沙漏
查看>>
visual studio 2005没有找到MSVCR80D.dll问题
查看>>
获取鼠标的当前位置
查看>>
django_models_一对一关系
查看>>
内核常见锁的机制与实现分析2
查看>>
Configure the handler mapping priority in Spring MVC
查看>>
Send an image over a network using Qt
查看>>
ubuntu下安装ftp服务器
查看>>
sites
查看>>
第14章 Python和XML
查看>>
request:域
查看>>
mac vim 配色
查看>>
Win10 使用笔记
查看>>