I have created a PHP script to query an LDAP server (running Microsoft Active Directory) and retrieve a list of Groups from a specific OU. This all works OK. However, I now need to pull out the list of Users for each Group. The attributes returned from AD, don’t appear to include this, and I can’t find a way to pull them out.
I have created a work around which will pull every User from a specific OU and check it’s list of Groups against the one I am looking at, but this is very inefficient as I am generally pulling 100+ Groups.
Another concern, is that each Group could potentially have Users from 70+ different domains, which would be impossible to search each time.
So, basically, I need to be able to pull the list of Users directly from the Groups. Does anyone know a way I can achieve this with PHP?
You need to bind with a valid username/password to be able to see the “members” attribute. Threw me for a bit, as most other stuff seems to be available without authenticating.