From 24a0f484803c6a85b57d0f7aa5d110c105dbaf0e Mon Sep 17 00:00:00 2001 From: rdolezel Date: Wed, 21 Mar 2012 19:10:41 +0100 Subject: [PATCH] Fix to support Exchange 2007 or 2010 without ABP --- .../Exchange2007.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs index ff5253fe..1a569e98 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs @@ -5001,7 +5001,22 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogStart("CreateOfflineAddressBook"); string oabName = GetOfflineAddressBookName(organizationId); - string addressListName = GetGlobalAddressListName(organizationId); + + bool enableSP2abp = false; + if (ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP] != null) + enableSP2abp = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP]); + Version exchangeVersion = GetExchangeVersion(); + string addressListName; + if (enableSP2abp && (exchangeVersion >= new Version(14, 2))) + { + // Ex2010SP2 with ABP support, want to use GAL for OAB + addressListName = GetGlobalAddressListName(organizationId); + } + else + { + // Ex2007 or Ex2010 without ABP support, have to use AL for OAB + addressListName = GetAddressListName(organizationId); + } Command cmd = new Command("New-OfflineAddressBook"); cmd.Parameters.Add("Name", oabName);