title: SQL LDAP Query Issue
body: <p>Trying to filter AD groups. I've got this that works:</p>
  
  <pre><code>SELECT name, distinguishedName    
  FROM OPENQUERY( ADSI,'SELECT name, distinguishedName    
  FROM ''LDAP://hhsc.org/DC=hhsc, DC=org''    
  WHERE objectCategory = ''group'' AND proxyAddresses=''*'' ')    
  ORDER BY name
  </code></pre>
  
  <p>It works but we've got email addresses in Security Groups, so I'm trying filter that with this:</p>
  
  <pre><code>SELECT name, distinguishedName    
  FROM OPENQUERY( ADSI,'SELECT name, distinguishedName    
  FROM ''LDAP://hhsc.org/DC=hhsc, DC=org''    
  WHERE objectCategory=''group'' AND groupType:1.2.840.113556.1.4.803:=''2147483648'' ')
  
  ORDER BY name
  </code></pre>
  
  <p>It keeps throwing:</p>
  
  <p>Msg 7321, Level 16, State 2, Line 1
  An error occurred while preparing the query "SELECT name, distinguishedName
  FROM 'LDAP://hhsc.org/DC=hhsc, DC=org'
  WHERE objectCategory='group' &amp; groupType:1.2.840.113556.1.4.803:='2147483648' " for execution against OLE DB provider "ADsDSOObject" for linked server "ADSI". </p>
  
  <p>I suspect it's syntax in groupType, but it's got me beat. </p>
  
  <p>FYI that identifier or whatever you call it for groupType works in a CFLDAP query that gives me just my Distribution Lists.</p>
  
  <p>Been working on this off and on for awhile now, but am not making any progress.</p>
  
  <p>Thanks in advance.</p>