Solved

Remove Mail Contacts and MailUsers from Exchange Global Address List

Posted on 2011-09-02
7
1,250 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
  • 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
 
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

Join & Write a Comment

Resolve DNS query failed errors for Exchange
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now