Added: Auto Distribution of New Mailboxes in Exchange (item #168)
This commit is contained in:
parent
d1708e267f
commit
e903cc6273
2 changed files with 25 additions and 20 deletions
|
@ -1827,6 +1827,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
cmd = new Command("Enable-Mailbox");
|
cmd = new Command("Enable-Mailbox");
|
||||||
cmd.Parameters.Add("Identity", upn);
|
cmd.Parameters.Add("Identity", upn);
|
||||||
cmd.Parameters.Add("Alias", accountName);
|
cmd.Parameters.Add("Alias", accountName);
|
||||||
|
if (!(mailboxDatabase == "*" && exchangeVersion >= new Version(14, 0)))
|
||||||
cmd.Parameters.Add("Database", mailboxDatabase);
|
cmd.Parameters.Add("Database", mailboxDatabase);
|
||||||
if (accountType == ExchangeAccountType.Equipment)
|
if (accountType == ExchangeAccountType.Equipment)
|
||||||
cmd.Parameters.Add("Equipment");
|
cmd.Parameters.Add("Equipment");
|
||||||
|
@ -1976,6 +1977,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
cmd.Parameters.Add("DisplayName", displayName);
|
cmd.Parameters.Add("DisplayName", displayName);
|
||||||
cmd.Parameters.Add("Password", securePassword);
|
cmd.Parameters.Add("Password", securePassword);
|
||||||
cmd.Parameters.Add("ResetPasswordOnNextLogon", false);
|
cmd.Parameters.Add("ResetPasswordOnNextLogon", false);
|
||||||
|
if (!(mailboxDatabase == "*" && exchangeVersion >= new Version(14, 0)))
|
||||||
cmd.Parameters.Add("Database", mailboxDatabase);
|
cmd.Parameters.Add("Database", mailboxDatabase);
|
||||||
if (accountType == ExchangeAccountType.Equipment)
|
if (accountType == ExchangeAccountType.Equipment)
|
||||||
cmd.Parameters.Add("Equipment");
|
cmd.Parameters.Add("Equipment");
|
||||||
|
@ -5007,13 +5009,10 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
cmd.Parameters.Add("AddressLists", addressListName);
|
cmd.Parameters.Add("AddressLists", addressListName);
|
||||||
cmd.Parameters.Add("PublicFolderDistributionEnabled", true);
|
cmd.Parameters.Add("PublicFolderDistributionEnabled", true);
|
||||||
cmd.Parameters.Add("IsDefault", false);
|
cmd.Parameters.Add("IsDefault", false);
|
||||||
|
if (!string.IsNullOrEmpty(oabVirtualDirs))
|
||||||
|
|
||||||
//TODO: fix web distribution
|
|
||||||
/*if (!string.IsNullOrEmpty(oabVirtualDir))
|
|
||||||
{
|
{
|
||||||
cmd.Parameters.Add("VirtualDirectories", oabVirtualDirs);
|
cmd.Parameters.Add("VirtualDirectories", oabVirtualDirs);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
Collection<PSObject> result = ExecuteShellCommand(runSpace, cmd);
|
Collection<PSObject> result = ExecuteShellCommand(runSpace, cmd);
|
||||||
string id = GetResultObjectDN(result);
|
string id = GetResultObjectDN(result);
|
||||||
|
|
|
@ -202,6 +202,8 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
{
|
{
|
||||||
ExchangeLog.LogStart("CreateMailboxDatabase");
|
ExchangeLog.LogStart("CreateMailboxDatabase");
|
||||||
string id;
|
string id;
|
||||||
|
if (name != "*")
|
||||||
|
{
|
||||||
Command cmd = new Command("Get-MailboxDatabase");
|
Command cmd = new Command("Get-MailboxDatabase");
|
||||||
cmd.Parameters.Add("Identity", name);
|
cmd.Parameters.Add("Identity", name);
|
||||||
Collection<PSObject> result = ExecuteShellCommand(runSpace, cmd);
|
Collection<PSObject> result = ExecuteShellCommand(runSpace, cmd);
|
||||||
|
@ -213,7 +215,11 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
{
|
{
|
||||||
throw new Exception(string.Format("Mailbox database {0} not found", name));
|
throw new Exception(string.Format("Mailbox database {0} not found", name));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
id = "*";
|
||||||
|
}
|
||||||
ExchangeLog.LogEnd("CreateMailboxDatabase");
|
ExchangeLog.LogEnd("CreateMailboxDatabase");
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue