From d00cb1bb017c253449ec32b8662adc0b12c09274 Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Wed, 29 Oct 2014 03:54:39 +0300 Subject: [PATCH] Exchange 2013: fix organization root public folder permission --- .../Exchange2013.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs index 1eaeef42..62df4ff6 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs @@ -4484,6 +4484,14 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("CheckOrganizationRootFolder"); } + private void CheckOrganizationRootPublicFolderPermission(Runspace runSpace, string organizationId) + { + string rootFolder = "\\" + organizationId; + + // exchange transport needs access to create new items in order to deliver email + AddPublicFolderClientPermission(runSpace, rootFolder, "Anonymous", "CreateItems"); + } + public string CreateOrganizationRootPublicFolder(string organizationId, string organizationDistinguishedName, string securityGroup, string organizationDomain) { ExchangeLog.LogStart("CreateOrganizationRootPublicFolder"); @@ -4506,10 +4514,7 @@ namespace WebsitePanel.Providers.HostedSolution res = orgCanonicalName + "/" + GetPublicFolderMailboxName(organizationId); - string rootFolder = "\\" + organizationId; - - // exchange transport needs access to create new items in order to deliver email - AddPublicFolderClientPermission(runSpace, rootFolder, "Anonymous", "CreateItems"); + CheckOrganizationRootPublicFolderPermission(runSpace, organizationId); } finally { @@ -4751,6 +4756,7 @@ namespace WebsitePanel.Providers.HostedSolution System.Threading.Thread.Sleep(5000); } + CheckOrganizationRootPublicFolderPermission(runSpace, organizationId); } finally {