查询所有用户与LDAP系统 [英] Query all the users in a system with LDAP

查看:409
本文介绍了查询所有用户与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系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆