If I understand, you want to find all users that are disabled but do NOT have "delete" in the description attribute? This should do that:
(&(objectClass=user)(objectCategory=person)(employeeID=*)(sn=*)(Company=*)(u serAccountControl:1.2.840.113556.1.4.803:=2)(!(description=*delete*))) The objectCategory=person clause may be redundant... all user objects have "person" as the objectCategory AFAIK. I also note that your original query has "Description" instead of "description". That shouldn't cause a problem, but.... For continued laughs, see http://www.contrib.andrew.cmu.edu/~norm/TakeMeAway.html -gil Gil Kirkpatrick Chief Technology Officer, NetPro Author of "Active Directory Programming" from MacMillan Got eBook? Get your free Active Directory Troubleshooting eBook at: http://www.netpro.com/ebook -----Original Message----- From: Stephens, Brendan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 12:03 PM To: '[EMAIL PROTECTED] ' Subject: [ActiveDir] AD Query Builder Has anyone seen an Active Directory Query Builder.... I'm getting so fustrated trying to correct syntax and return results, especially with multiple criteria...it's driving me mad... MAD I TELL YOU... They're coming to take me away, ha, ha... They're coming to take me away, ho, ho... To the Funny Farm...Where the grass is green all the time... This Query will return Users who's accounts are disabled, and have the word delete in their description... (&(objectClass=user)(objectCategory=person)(employeeID=*)(sn=*)(Company=*)(u serAccountControl:1.2.840.113556.1.4.803:=2)(Description=*delete*)); But If I try to exclude the disabled accounts with the word delete in their description... notta. (&(objectClass=user)(objectCategory=person)(employeeID=*)(sn=*)(Company=*) (!(userAccountControl:1.2.840.113556.1.4.803:=2)(Description=*delete*))); or (&(objectClass=user)(objectCategory=person)(employeeID=*)(sn=*)(Company=*))( !(userAccountControl:1.2.840.113556.1.4.803:=2)(Description=*delete*)); Coffee...Coffeeeeee.. List info : http://www.activedir.org/mail_list.htm List FAQ : http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/ List info : http://www.activedir.org/mail_list.htm List FAQ : http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
