Exchange2013 DefaultPublicFolderMailbox fix

This commit is contained in:
dev_amdtel 2014-10-23 01:19:16 +04:00
parent 510f0e2810
commit b3dc88fe86
7 changed files with 2896 additions and 2083 deletions

View file

@ -1782,7 +1782,9 @@ namespace WebsitePanel.EnterpriseServer
//GetServiceSettings
StringDictionary primSettings = ServerController.GetServiceSettings(exchangeServiceId);
string samAccount = exchange.CreateMailEnableUser(email, org.OrganizationId, org.DistinguishedName, accountType, primSettings["mailboxdatabase"],
string samAccount = exchange.CreateMailEnableUser(email, org.OrganizationId, org.DistinguishedName,
org.SecurityGroup, org.DefaultDomain,
accountType, primSettings["mailboxdatabase"],
org.OfflineAddressBook,
org.AddressBookPolicy,
retUser.SamAccountName,

View file

@ -37,7 +37,9 @@ namespace WebsitePanel.Providers.HostedSolution
bool CheckAccountCredentials(string username, string password);
// Organizations
string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType,
string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName,
string securityGroup, string organizationDomain,
ExchangeAccountType accountType,
string mailboxDatabase, string offlineAddressBook, string addressBookPolicy,
string accountName, bool enablePOP, bool enableIMAP,
bool enableOWA, bool enableMAPI, bool enableActiveSync,

View file

@ -1871,14 +1871,18 @@ namespace WebsitePanel.Providers.HostedSolution
}
public string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType,
public string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName,
string securityGroup, string organizationDomain,
ExchangeAccountType accountType,
string mailboxDatabase, string offlineAddressBook, string addressBookPolicy,
string accountName, bool enablePOP, bool enableIMAP,
bool enableOWA, bool enableMAPI, bool enableActiveSync,
long issueWarningKB, long prohibitSendKB, long prohibitSendReceiveKB, int keepDeletedItemsDays,
int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook, bool IsConsumer, bool enabledLitigationHold, long recoverabelItemsSpace, long recoverabelItemsWarning)
{
return CreateMailEnableUserInternal(upn, organizationId, organizationDistinguishedName, accountType,
return CreateMailEnableUserInternal(upn, organizationId, organizationDistinguishedName,
securityGroup, organizationDomain,
accountType,
mailboxDatabase, offlineAddressBook, addressBookPolicy,
accountName, enablePOP, enableIMAP,
enableOWA, enableMAPI, enableActiveSync,
@ -1886,7 +1890,9 @@ namespace WebsitePanel.Providers.HostedSolution
keepDeletedItemsDays, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, hideFromAddressBook, IsConsumer, enabledLitigationHold, recoverabelItemsSpace, recoverabelItemsWarning);
}
internal virtual string CreateMailEnableUserInternal(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType,
internal virtual string CreateMailEnableUserInternal(string upn, string organizationId, string organizationDistinguishedName,
string securityGroup, string organizationDomain,
ExchangeAccountType accountType,
string mailboxDatabase, string offlineAddressBook, string addressBookPolicy,
string accountName, bool enablePOP, bool enableIMAP,
bool enableOWA, bool enableMAPI, bool enableActiveSync,
@ -1955,8 +1961,19 @@ namespace WebsitePanel.Providers.HostedSolution
transaction.RegisterEnableMailbox(id);
// default public folder
string orgCanonicalName = ConvertADPathToCanonicalName(organizationDistinguishedName);
//create organization public folder mailbox if required
CheckOrganizationPublicFolderMailbox(runSpace, orgCanonicalName, organizationId, organizationDomain);
//create organization root folder if required
CheckOrganizationRootFolder(runSpace, organizationId, securityGroup, orgCanonicalName, organizationId);
string windowsEmailAddress = ObjToString(GetPSObjectProperty(result[0], "WindowsEmailAddress"));
string defaultPublicFolderMailbox = orgCanonicalName + "/" + GetPublicFolderMailboxName(organizationId);
//update mailbox
cmd = new Command("Set-Mailbox");
cmd.Parameters.Add("Identity", id);
@ -1987,6 +2004,8 @@ namespace WebsitePanel.Providers.HostedSolution
cmd.Parameters.Add("RecoverableItemsWarningQuota", ConvertKBToUnlimited(recoverabelItemsWarning));
}
cmd.Parameters.Add("DefaultPublicFolderMailbox", defaultPublicFolderMailbox);
ExecuteShellCommand(runSpace, cmd);
//Litigation Hold

View file

@ -1784,7 +1784,9 @@ namespace WebsitePanel.Providers.HostedSolution
}
public string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType,
public string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName,
string securityGroup, string organizationDomain,
ExchangeAccountType accountType,
string mailboxDatabase, string offlineAddressBook, string addressBookPolicy,
string accountName, bool enablePOP, bool enableIMAP,
bool enableOWA, bool enableMAPI, bool enableActiveSync,

View file

@ -325,7 +325,8 @@ namespace WebsitePanel.Providers.HostedSolution
#endregion
#region Mailbox
internal override string CreateMailEnableUserInternal(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType,
internal override string CreateMailEnableUserInternal(string upn, string organizationId, string organizationDistinguishedName,
ExchangeAccountType accountType,
string mailboxDatabase, string offlineAddressBook, string addressBookPolicy,
string accountName, bool enablePOP, bool enableIMAP,
bool enableOWA, bool enableMAPI, bool enableActiveSync,

View file

@ -90,7 +90,9 @@ namespace WebsitePanel.Server
}
[WebMethod, SoapHeader("settings")]
public string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType,
public string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName,
string securityGroup, string organizationDomain,
ExchangeAccountType accountType,
string mailboxDatabase, string offlineAddressBook, string addressBookPolicy,
string accountName, bool enablePOP, bool enableIMAP,
bool enableOWA, bool enableMAPI, bool enableActiveSync,
@ -100,7 +102,9 @@ namespace WebsitePanel.Server
try
{
LogStart("CreateMailEnableUser");
string ret = ES.CreateMailEnableUser(upn, organizationId, organizationDistinguishedName, accountType,
string ret = ES.CreateMailEnableUser(upn, organizationId, organizationDistinguishedName,
securityGroup, organizationDomain,
accountType,
mailboxDatabase, offlineAddressBook, addressBookPolicy,
accountName, enablePOP, enableIMAP,
enableOWA, enableMAPI, enableActiveSync,