title: PHP LDAP query to get members of specific security Group
body: <p>I am struggling to get an LDAP query to work to give me members of a security Group.</p>
  
  <p>Our active directory structure is set up with </p>
  
  <p><code>DC=domain,DC=co,dc=uk</code>
  We then have a OU called Company users and within that an OU for IT,and Standard.</p>
  
  <p>Within these we have the users created</p>
  
  <p>So I am set up as  <code>CN=my name,OU=IT,OU=company users,DC=domain,DC=co,dc=uk</code></p>
  
  <p>The security Group is <code>CN=Test,OU=Security Group,DC=domain,DC=co,dc=uk</code></p>
  
  <p>Of which I am a member of .</p>
  
  <p>I have a PHP page that runs an LDAP query that is set to have a DN of <code>OU=Company users,DC=domain,DC=co,dc=uk</code> with a filter of <code>(&amp;(objectClass=user)(objectCategory=person))</code> and this returns all users and works fine.</p>
  
  <p>I can not however get it to return just members of my Test group even though I seem to have tried every query Google has given me.</p>
  
  <p>I think it is due to how we have the structure set up.</p>
  
  <p>Can anyone help.</p>