{"id":819,"date":"2010-05-15T09:05:18","date_gmt":"2010-05-15T09:05:18","guid":{"rendered":"https:\/\/www.wapshere.com\/missmiis\/?p=819"},"modified":"2022-10-31T02:44:06","modified_gmt":"2022-10-31T02:44:06","slug":"a-galsync-powershell-script","status":"publish","type":"post","link":"https:\/\/www.wapshere.com\/missmiis\/a-galsync-powershell-script","title":{"rendered":"A GALSync powershell script"},"content":{"rendered":"<p>Here is a script I wrote to do a simple GAL synchronization between two Exchange organizations. The script finds the mail-enabled\u00a0 users in one domain, and creates contacts for them in the other domain. Existing contacts will also be updated and deleted as needed.<br \/>\n<!--more--><\/p>\n<h4>Update<\/h4>\n<p>There was a bug in the original script where I had forgotten to populate mailNickname. I have now done so, adding a &#8220;c-&#8221; to the front of it as a completely optional convention to avoid conflicts.<\/p>\n<h4>Update 2<\/h4>\n<p>Several people have commented below about needing to enable the contacts in Exchange after creation. I have used the modifications 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.<\/p>\n<h3>The Script<\/h3>\n<p>Now I have two versions the scripts have been moved off to separate pages. Follow the links below.<\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<td><a href=\"https:\/\/www.wapshere.com\/missmiis\/galsync-v2\">Version 2<\/a><\/td>\n<td>Added the Update-Recipient command for Exchange 2007 (through local PowerShell) and Exchange 2010 (through remote PowerShell).<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/www.wapshere.com\/missmiis\/galsync-ps1\">Version 1<\/a><\/td>\n<td>Original version that uses the ActiveDirectory PowerShell module to create the contact objects.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Other people&#8217;s versions<\/h3>\n<p>Modified for Distribution Lists: <a href=\"https:\/\/www.wapshere.com\/missmiis\/galsync-v2\/galsync-ps1-for-distribution-lists\">https:\/\/www.wapshere.com\/missmiis\/galsync-v2\/galsync-ps1-for-distribution-lists<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a script I wrote to do a simple GAL synchronization between two Exchange organizations. The script finds the mail-enabled\u00a0 users in one domain, and creates contacts for them in the other domain. Existing contacts will also be updated and deleted as needed.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[24,27,26,43,23],"tags":[],"class_list":["post-819","post","type-post","status-publish","format-standard","hentry","category-ad","category-exchange2003","category-exchange2007","category-exchange-2010","category-powershell"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pkp1o-dd","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/comments?post=819"}],"version-history":[{"count":12,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/819\/revisions"}],"predecessor-version":[{"id":3304,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/819\/revisions\/3304"}],"wp:attachment":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/media?parent=819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/categories?post=819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/tags?post=819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}