Nov 11
NerrWeb|PHP|MySQL|jQuery
在使用php连接ldap向ad中添加用户的时候遇到问题:“Server is unwilling to perform”,搜索之后发现相关资料不多,并且——解释五花八门。最后得到了同事的启发,发现这个报错与用户密码有关,把密码参数去掉后创建用户的操作返回了true,再看AD中的这个用户的状态却是禁用的。有点不理解,但总算有了些进展。
(续)上周又有了新的进展,但一直没时间更新日志。前几天找到一篇Loudly前辈的文章,链接地址:http://blog.loudly.cn/2007/11/4bfe75d9de3096a90055876934b77f21/ 。文章中提到的工作环境跟我的现在很相似,基本上可以确认不能操作用户密码的问题与SSL有关,但由于一些限制我现在没有办法进行测试,测试的工作会在最近的1-2周内完成,到时候再把我的测试结果发上来吧。
再续
PHP connect AD with LDAP over SSL (LDAPs)
Oct 30
NerrWeb|PHP|MySQL|jQuery
最近在研究用php ldap连接active directory(主要是使用adLDAP类),在使用folder_list()方法递归OU的时候发现报错,即ldap_search(): Partial search results returned: Sizelimit exceeded——只能查询1000个对象,google了一下,发现ad ldap默认的策略是有限制的(估计是考虑到性能的因素),将默认的MaxPageSize参数修改为一个较大的值即可(例如3000,我的测试环境里2000就够用了),修改方法如下。
Viewing current policy settings
- At the Ntdsutil.exe command prompt, type LDAP policies, and then press ENTER.
- At the LDAP policy command prompt, type connections, and then press ENTER.
- At the server connection command prompt, type connect to server <DNS name of server>, and then press ENTER. You want to connect to the server that your are currently working with.
- At the server connection command prompt, type q, and then press ENTER to return to the previous menu.
- At the LDAP policy command prompt, type Show Values, and then press ENTER.
A display of the policies as they exist appears.