查询所有用户与LDAP系统

编程入门 行业动态 更新时间:2024-10-26 08:34:03
本文介绍了查询所有用户与LDAP系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用的红宝石的净/ LDAP库这个问题,但在现实中的驱动程序语言不应该真正的问题。我需要找到一种方法,能够得到所有用户的系统并找出哪些用户不具有分配给该帐户的电子邮件。可能吗?

I am using ruby's net/ldap library for this problem but in reality the driver language shouldn't really matter. I need to find a way to be able to get all the users from a system and find out which users do not have emails assigned to the account. Is it possible?

我可以连接到甚至通过LDAP创造新的纪录,并且可以使用通配符输入来过滤返回结果的查询。

I can connect to and even create new records through LDAP, and can return queries by using wildcard entries to filter results.

给我创建一个过滤器来查找开头三个CN 9的:

given i create a filter to find the cn that begins with three 9's:

filter = Net::LDAP::Filter.eq("cn", "999*") @connection.search(:base => "cn=Manager, dc=foo, dc=bar, dc=biz", :filter => filter)

那么我的结果计数可能是42。

then my result count might be 42.

给我创造同样的过滤器,但只要求1九,查询将失败并返回false

given i create the same filter but request only 1 nine, the query fails and returns false

filter = Net::LDAP::Filter.eq("cn", "9*") @connection.search(:base => "cn=Manager, dc=foo, dc=bar, dc=biz", :filter => filter)

和这是一样的,如果我要求只是CN,*这对我来说应该说给我的CN的所有在那里。

and this is the same if I request just "cn", "*" which to me should say "give me all the cn's out there. ".

推荐答案

所以短期问题的答案是,这一切都取决于你的模式是设置。如果你正在建立一个LDAP模式,你需要有几组的各种CN(通用名)的标识符,如记录 CN = activeUsers 和 CN = inactiveUsers ,这将使你查询下表比我的情况更深刻。

So the short answer to the question is that it all depends on how your schema is setup. If you are setting up an LDAP schema, you need to have several groups of records with various cn (common name) identifiers, eg cn=activeUsers and cn=inactiveUsers which will allow you to query down the list much deeper than in my situation.

更多推荐

查询所有用户与LDAP系统

本文发布于:2023-10-21 17:35:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1514897.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:用户   系统   LDAP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!