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)))


Thanks

Nick
LVL 5
ncomperAsked:
Who is Participating?
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:
Hello,

You need to add msExchHideFromAddressLists=TRUE to your query.

JJ
0

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:
Specifically...

(&(&(&(& (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)))
0
ncomperAuthor Commented:
Hi

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

Thanks

Nick
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

ncomperAuthor Commented:
Hi jjmck

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

Thanks

Nick
LDAP-Query.JPG
0
ncomperAuthor Commented:
Hi

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))))
0
ncomperAuthor Commented:
Thanks for the help.
0
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
Exchange

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.