I have several prerequisites for the query, as display name doesn't contain some characters, based on the previous posts in this thread. In addition to that I want to have users which works in some departments (custom attribute 2) which are about 1000 people (3 departments all together) - this part is working.
From this list of people (1000) I would like to have list of those based on location (custom attribute 6) which are 12 locations. Here is where I stuck.
Here is the query that works:
(!displayName=*test*)(!employeeNumber=7*)(!displayName=R-*)(!msExchHideFromAddressLists=True)(!userAccountControl
:1.2.840.113556.1.4.803:=2)(|(extensionAttribute2=department1)(extensionAttribute2=department2)(extensionAttribute2=department3)
From this list I want to extract only those that "extensionAttribute6" is something. There is 12 locations.
12 x "extensionAttribute6" = all the people that working at those 12 locations.
I hope it more clear now.