Added: Auto Distribution of New Mailboxes in Exchange (item #168)

This commit is contained in:
feodor_fitsner 2012-03-07 15:05:50 -08:00
parent d1708e267f
commit e903cc6273
2 changed files with 25 additions and 20 deletions

View file

@ -202,18 +202,24 @@ namespace WebsitePanel.Providers.HostedSolution
{
ExchangeLog.LogStart("CreateMailboxDatabase");
string id;
Command cmd = new Command("Get-MailboxDatabase");
cmd.Parameters.Add("Identity", name);
Collection<PSObject> result = ExecuteShellCommand(runSpace, cmd);
if (result != null && result.Count > 0)
{
id = GetResultObjectIdentity(result);
}
else
{
throw new Exception(string.Format("Mailbox database {0} not found", name));
}
if (name != "*")
{
Command cmd = new Command("Get-MailboxDatabase");
cmd.Parameters.Add("Identity", name);
Collection<PSObject> result = ExecuteShellCommand(runSpace, cmd);
if (result != null && result.Count > 0)
{
id = GetResultObjectIdentity(result);
}
else
{
throw new Exception(string.Format("Mailbox database {0} not found", name));
}
}
else
{
id = "*";
}
ExchangeLog.LogEnd("CreateMailboxDatabase");
return id;
}