LDAP query works, but GC query fails
Posted on 2008-10-07
A web-based app is querying Active Directory. Everything has been working fine for the past couple of years, but now something is broken.
For all new user accounts added in the past month, they can be found with an LDAP:// query, but searching on the same user account with a GC:// query fails.
Here's a sample of the query. If I leave it as LDAP, then it returns a row for the user results. If I change the query to GC (which I want to since there are >1 domains) I get 0 rows returned, no results.
'SELECT sn, givenName, sAMAccountName, department, title, mail, createTimeStamp, telephoneNumber, physicalDeliveryOfficeName
FROM ''LDAP://Pdc'' where objectcategory=''Person'' and objectClass=''User''') ADSI
Where (sn <> 'NULL' and department <> 'NULL' and title <> 'NULL')
AND sAMAccountName = 'newhire'
Nothing that I know of has changed in the environment to cause this to stop working.
any help would be appreciated!!