Here is a script I wrote to do a simple GAL synchronization between two Exchange organizations. The script finds the mail-enabled users in one domain, and creates contacts for them in the other domain. Existing contacts will also be updated and deleted as needed.
There was a bug in the original script where I had forgotten to populate mailNickname. I have now done so, adding a “c-” to the front of it as a completely optional convention to avoid conflicts.
Several people have commented below about needing to enable the contacts in Exchange after creation. I have used the modifcations posted by Mark in the comments to make a new version that I hope will work better with 2007 and 2010, though I have only tested it with 2010. Both versions are linked below, and please keep adding your comments and modifications.
Now I have two versions the scripts have been moved off to seperate pages. Follow the links below.
|Version 2||Added the Update-Recipient command for Exchange 2007 (through local powershell) and Exchange 2010 (through remote powershell).|
|Version 1||Original version that uses the ActiveDirectory powershell module to create the contact objects.|
Other people’s versions
Modified for Distribution Lists: https://www.wapshere.com/missmiis/galsync-v2/galsync-ps1-for-distribution-lists