Exchange address book include all AD users

active-directoryexchangeexchange-2010

We currently have exchange 2010 setup as a test behind our domino servers. All our users are in Active Directory and have the AD mail attribute set to their email address. I would like to know if there is a way to include all AD users in the address book even if they do not have an exchange account. I have read this post:

Non-Exchange address in Exchange GAL

about creating separate contacts for the users but I would like to use the current AD users rather than keep a separate list of users. Any Ideas?

Best Answer

the only solution I have found is using the mailContact method. This is a hassle because you then have two lists, AD users and then the new contacts. There is no need to export the Domino address book as all the users are already in AD and have the mail attribute set. So what I did is created a powershell script that reads AD and creates a new contact for each AD user. It will remove existing contacts before adding the new one to keep the list upto date. I am going to run this on a schedule. Its not the best way but it seems to be the only way to do this.

#
# list all email addresses in active directory and create mail contacts
#
# Created By Thomas Wheeler
# wheelert@wheelerwire.com
#

$WarningPreference = "SilentlyContinue" 
$VerbosePreference = "SilentlyContinue"

add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010

$strFilter = "(&(objectCategory=User) )"

$objDomain = New-Object System.DirectoryServices.DirectoryEntry

$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.PageSize = 1000
$objSearcher.Filter = $strFilter
$objSearcher.SearchScope = "Subtree"

$colProplist = "name", "mail"
foreach ($i in $colPropList){
    $objSearcher.PropertiesToLoad.Add($i)
}

$colResults = $objSearcher.FindAll()

foreach ($objResult in $colResults){
    $objItem = $objResult.Properties; 
    if($objItem.mail -ne $null ){
        #Write-Host $objItem.name " (" $objItem.mail " )" $objItem.sAMAccountType 
        $name = $objItem.name | Out-String
        $email = $objItem.mail | Out-String
        Remove-MailContact -Identity $name.trim() -Confirm:$false   
        New-MailContact -Name:$name.trim() -ExternalEmailAddress $email.trim()

    }

}
Related Topic