Solved

Remove Mail Contacts and MailUsers from Exchange Global Address List

Posted on 2011-09-02
7
1,299 Views
Last Modified: 2012-05-12
Active Directory version:  2008
Forest Functional Level:  2008
Domain Functional Level:  2008
Exchange version:  2010 SP1

We have a lot of "contacts" and "mailusers" in our Active Directory environment. To be clear, we are _not_ talking about AD users who have mailboxes - but rather AD objects _apart from_ users that have 'proxyaddresses' and 'aliases'.

What I want to do, is remove the 'contacts' and 'mailusers' from the main Global Address List, yet let them remain in the "All Contacts" address list.

I have followed this article:
http://exchangeserverpro.com/how-to-remove-mail-users-from-the-global-address-list

and this article:
http://www.infinitec.de/post/2005/02/How-to-get-the-Global-Address-List-programatically.aspx

But no luck - the 'contacts' and 'mailusers' still show up in the GAL. I have viewed from OWA and the list is the same as the OAB in Outlook: they both show the contacts and mailusers.

What is the trick to accomplish the removal of 'contacts' and 'mailusers' from _only_ the GAL - and still let them be listed in the "All Contacts" address list?

Thanks
0
Comment
Question by:neilpage99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
7 Comments
 
LVL 17

Expert Comment

by:Kent Dyer
ID: 36476855
Have a look at this..

Look at the following page - http://technet.microsoft.com/en-us/library/ff607299.aspx

This does look like some pretty "gnarly" scripting dude!!  LOL!!

Have fun!

Kent
0
 
LVL 9

Author Comment

by:neilpage99
ID: 36477339
I appreciate your reply kdyer, but I'm not sure what 'New-MailboxExportRequest' has to do with my request.
0
 
LVL 4

Expert Comment

by:ontech
ID: 36477619
think you are talking about Default GAL which contains all recipients in Exchange server.

So if you will see the Recipient Filter of this GAL using following command in EMS:

Get-GlobalAddressList "Default Global Address List" |FL *Filter

you will see a filter like:
{(Alias -ne $null -and (ObjectClass -eq 'user' -or ObjectClass -eq 'contact' -or ObjectClass -eq 'msExchSystemMailbox' -or ObjectClass -eq 'msExchDynamicDistributionList' -or ObjectClass -eq 'group' -or ObjectClass -eq 'publicFolder'))}

You can see it by default contains the Contacts too bcoz of the condition or ObjectClass -eq 'contact' .

So if you want that your default GAL exclude these contacts object then you will have to reset the Recipient Filter of your GAL like this:

Set-GlobalAddressList "Default Global Address List" -RecipientFilter {(Alias -ne $null -and (ObjectClass -eq 'user' -or ObjectClass -eq 'msExchSystemMailbox' -or ObjectClass -eq 'msExchDynamicDistributionList' -or ObjectClass -eq 'group' -or ObjectClass -eq 'publicFolder'))}

and then will have to create some other GAL for the contacts like this:

New-GlobalAddressList "Contacts Global Address List" -RecipientFilter {(Alias -ne $null -and ObjectClass -eq 'Contact')}

By default exchange contains an Address List with the name "All Contacts" for all contacts.

Also you will have to do some extra work to show a specific GAL to a set of users using user's Active Directory attribute "msExchQueryBaseDN".

Hope this is informative for you.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 9

Author Comment

by:neilpage99
ID: 36478115
Thank you, ontech, but that's exactly what I did already. The articles above, which I listed in my first post, explain the same thing you suggested. I have done that, but the Default GAL still shows my contacts.

I also notice the AD Attribute:  "showinaddressbook" for each contact, it lists "Default Global Address List". If I remove that from the attribute, the contact won't be listed in the GAL any more. Does this setting overide the recipient filter on the GAL?  Is there a powershell script that can remove that item from the "showinaddressbook" attributes of _ALL_ the contacts at once?

I really appreciate your help.
0
 
LVL 9

Author Comment

by:neilpage99
ID: 36480988
I have created a brand new Global Address List called "Company Directory", using the recipient filter I wanted, which does _not_ include contacts or "mailusers". I used powershell to perform:
Get-Recipient -filter "AddressListMembership -eq '$((Get-GlobalAddressList "Company Directory").DistinguishedName)'"

Open in new window

...and it displays exactly what I want: no contacts or mailusers. It's been 36 hours and both Outlook and OWA _still_ show the contents of the original Default Global Address List. I checked, and the new "Company Directory" is set to $true for "IsDefaultGlobalAddressList". If I take one test contact and remove the "Default Global Address List" from his "showinaddressbook" attribute, he dissappears from the GAL which seems to prove that the old Default GAL is still being used even though it shouldn't be.

Anyone with any other ideas?
0
 
LVL 9

Accepted Solution

by:
neilpage99 earned 0 total points
ID: 37779690
Nothing...
I'm closing my question, thanks anyway.
0
 
LVL 9

Author Closing Comment

by:neilpage99
ID: 37795209
No one gave me any tips, just repeated what I already did.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Here's a look at newsworthy articles and community happenings during the last month.
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question