Solved

Remove Mail Contacts and MailUsers from Exchange Global Address List

Posted on 2011-09-02
7
1,267 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
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…

776 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