获取特定组内的用户列表

I am trying to query a list of users within a specific active directory group using PHP and LDAP.

I am making the connection and bind as normal:

$connection = ldap_connect($hostname);
$bind = ldap_bind($connection, $username, $password);

For this example, the name of the group I need to acquire the list of users from is "Test Group". There is also a OU of "LDAPTest".

I have tried all of the following, plus a bunch of other ways, and I am just not finding the method to get all of the users within the group "Test Group", which has four users that have been added to it.

$result = ldap_search($connection,"OU=LDAPTest,DC=example,DC=net", "(CN=*)");
$result = ldap_search($connection,"OU=LDAPTest,DC=example,DC=net", "memberOf=Test Group");
$result = ldap_search($connection,"memberOf=Test Group,DC=example,DC=net", "CN=*");
$result = ldap_search($connection,"memberOf=Test Group,DC=example,DC=net", "CN=*");
查看全部
drpjdfj618393
drpjdfj618393
2012/11/01 21:21
  • ldap
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复