Exchange Custom address list based on company - will it exclude accounts hidden from GAL

Hi All

I have a question thats been puzzling me, we use an LDAP filter to create an address book based on the users company attribute, this works fine, however i needed to create a report for all users in that address book which i though would be easy, i just copied the ldap query on the custom address list and created a saved query in ADUC and then ran it,

However when i preview the query within Exchange System manager it shows 2700 users, when i run the same query from within ADUC and export it to a CSV it shows 3500 users. Exchange must be exluding accounts that the Save query is not, can anyone tell me what i need to do to the below to make sure it displays the same users as the Query that populates the address list.

(&(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList) )))(objectCategory=user)(company=ABS Branch)))


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jamie McKillopIT ManagerCommented:

You need to add msExchHideFromAddressLists=TRUE to your query.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jamie McKillopIT ManagerCommented:

(&(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)(!(msExchHideFromAddressLists=TRUE)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList) )))(objectCategory=user)(company=ABS Branch)))
ncomperAuthor Commented:

I get an error stating invlaid query when i try and run that, ill post the screenshot on Tuesday


Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

ncomperAuthor Commented:
Hi jjmck

I have tried running that query but i get the attached error, any ideas?


ncomperAuthor Commented:

Just FYI for perople searching this in future, the below query gave me an exact match that i was getting when previewing the query on the properties of the address list.

(&(&(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=msExchDynamicDistributionList) )))(objectCategory=user)(company=ABS Branch)(!msExchHideFromAddressLists=TRUE))))
ncomperAuthor Commented:
Thanks for the help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.