Partial fixed on exchange 2013 litigation hold
This commit is contained in:
parent
b7ab52690e
commit
f924299d3e
2 changed files with 60 additions and 9 deletions
|
@ -5,11 +5,11 @@
|
||||||
</configSections>
|
</configSections>
|
||||||
<!-- Connection strings -->
|
<!-- Connection strings -->
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="EnterpriseServer" connectionString="Server=(local)\SQLExpress;Database=WebsitePanel;uid=sa;pwd=Password12" providerName="System.Data.SqlClient" />
|
<add name="EnterpriseServer" connectionString="server=2012PROV01;database=WebsitePanel;uid=WebsitePanel;pwd=5qc7ftf6q42byc08z857;Connection Timeout=60;" />
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<!-- Encryption util settings -->
|
<!-- Encryption util settings -->
|
||||||
<add key="WebsitePanel.CryptoKey" value="1234567890" />
|
<add key="WebsitePanel.CryptoKey" value="fbd61z4gwsc2m01x7xn2" />
|
||||||
<!-- A1D4KDHUE83NKHddF -->
|
<!-- A1D4KDHUE83NKHddF -->
|
||||||
<add key="WebsitePanel.EncryptionEnabled" value="true" />
|
<add key="WebsitePanel.EncryptionEnabled" value="true" />
|
||||||
<!-- Web Applications -->
|
<!-- Web Applications -->
|
||||||
|
@ -21,6 +21,7 @@
|
||||||
<!-- Alternative connection string, pulls the value from registry -->
|
<!-- Alternative connection string, pulls the value from registry -->
|
||||||
<add key="WebsitePanel.AltConnectionString" value="ConnectionString" />
|
<add key="WebsitePanel.AltConnectionString" value="ConnectionString" />
|
||||||
<add key="WebsitePanel.AltCryptoKey" value="CryptoKey" />
|
<add key="WebsitePanel.AltCryptoKey" value="CryptoKey" />
|
||||||
|
<add key="WebsitePanel.DistableScheduler" value="false" />
|
||||||
</appSettings>
|
</appSettings>
|
||||||
<system.web>
|
<system.web>
|
||||||
<!-- Disable any authentication -->
|
<!-- Disable any authentication -->
|
||||||
|
|
|
@ -1934,13 +1934,22 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
|
|
||||||
if (enabledLitigationHold)
|
if (enabledLitigationHold)
|
||||||
{
|
{
|
||||||
cmd.Parameters.Add("LitigationHoldEnabled", true);
|
|
||||||
cmd.Parameters.Add("RecoverableItemsQuota", ConvertKBToUnlimited(recoverabelItemsSpace));
|
cmd.Parameters.Add("RecoverableItemsQuota", ConvertKBToUnlimited(recoverabelItemsSpace));
|
||||||
cmd.Parameters.Add("RecoverableItemsWarningQuota", ConvertKBToUnlimited(recoverabelItemsWarning));
|
cmd.Parameters.Add("RecoverableItemsWarningQuota", ConvertKBToUnlimited(recoverabelItemsWarning));
|
||||||
}
|
}
|
||||||
|
|
||||||
ExecuteShellCommand(runSpace, cmd);
|
ExecuteShellCommand(runSpace, cmd);
|
||||||
|
|
||||||
|
//Litigation Hold
|
||||||
|
if (enabledLitigationHold)
|
||||||
|
{
|
||||||
|
cmd = new Command("New-MailboxSearch");
|
||||||
|
cmd.Parameters.Add("Name", upn);
|
||||||
|
cmd.Parameters.Add("InPlaceHoldEnabled", enabledLitigationHold);
|
||||||
|
cmd.Parameters.Add("SourceMailboxes", upn);
|
||||||
|
ExecuteShellCommand(runSpace, cmd);
|
||||||
|
}
|
||||||
|
|
||||||
//Client Access
|
//Client Access
|
||||||
cmd = new Command("Set-CASMailbox");
|
cmd = new Command("Set-CASMailbox");
|
||||||
cmd.Parameters.Add("Identity", id);
|
cmd.Parameters.Add("Identity", id);
|
||||||
|
@ -2267,7 +2276,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
|
|
||||||
info.DisplayName = (string)GetPSObjectProperty(mailbox, "DisplayName");
|
info.DisplayName = (string)GetPSObjectProperty(mailbox, "DisplayName");
|
||||||
info.HideFromAddressBook = (bool)GetPSObjectProperty(mailbox, "HiddenFromAddressListsEnabled");
|
info.HideFromAddressBook = (bool)GetPSObjectProperty(mailbox, "HiddenFromAddressListsEnabled");
|
||||||
info.EnableLitigationHold = (bool)GetPSObjectProperty(mailbox, "LitigationHoldEnabled");
|
|
||||||
|
|
||||||
Command cmd = new Command("Get-User");
|
Command cmd = new Command("Get-User");
|
||||||
cmd.Parameters.Add("Identity", accountName);
|
cmd.Parameters.Add("Identity", accountName);
|
||||||
|
@ -2298,6 +2307,18 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
info.WebPage = (string)GetPSObjectProperty(user, "WebPage");
|
info.WebPage = (string)GetPSObjectProperty(user, "WebPage");
|
||||||
info.Notes = (string)GetPSObjectProperty(user, "Notes");
|
info.Notes = (string)GetPSObjectProperty(user, "Notes");
|
||||||
|
|
||||||
|
//Litigation Hold
|
||||||
|
info.EnableLitigationHold = false;
|
||||||
|
cmd = new Command("Get-MailboxSearch");
|
||||||
|
cmd.Parameters.Add("Identity", accountName);
|
||||||
|
result = ExecuteShellCommand(runSpace, cmd);
|
||||||
|
if ((result != null) & (result.Count > 0))
|
||||||
|
{
|
||||||
|
mailbox = result[0];
|
||||||
|
info.EnableLitigationHold = (bool)GetPSObjectProperty(mailbox, "InPlaceHoldEnabled");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@ -2478,8 +2499,6 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
info.KeepDeletedItemsDays =
|
info.KeepDeletedItemsDays =
|
||||||
ConvertEnhancedTimeSpanToDays((EnhancedTimeSpan)GetPSObjectProperty(mailbox, "RetainDeletedItemsFor"));
|
ConvertEnhancedTimeSpanToDays((EnhancedTimeSpan)GetPSObjectProperty(mailbox, "RetainDeletedItemsFor"));
|
||||||
|
|
||||||
info.EnableLitigationHold = (bool)GetPSObjectProperty(mailbox, "LitigationHoldEnabled");
|
|
||||||
|
|
||||||
info.RecoverabelItemsSpace =
|
info.RecoverabelItemsSpace =
|
||||||
ConvertUnlimitedToKB((Unlimited<ByteQuantifiedSize>)GetPSObjectProperty(mailbox, "RecoverableItemsQuota"));
|
ConvertUnlimitedToKB((Unlimited<ByteQuantifiedSize>)GetPSObjectProperty(mailbox, "RecoverableItemsQuota"));
|
||||||
info.RecoverabelItemsWarning =
|
info.RecoverabelItemsWarning =
|
||||||
|
@ -2497,6 +2516,18 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
info.EnablePOP = (bool)GetPSObjectProperty(mailbox, "PopEnabled");
|
info.EnablePOP = (bool)GetPSObjectProperty(mailbox, "PopEnabled");
|
||||||
info.EnableIMAP = (bool)GetPSObjectProperty(mailbox, "ImapEnabled");
|
info.EnableIMAP = (bool)GetPSObjectProperty(mailbox, "ImapEnabled");
|
||||||
|
|
||||||
|
//Litigation Hold
|
||||||
|
info.EnableLitigationHold = false;
|
||||||
|
cmd = new Command("Get-MailboxSearch");
|
||||||
|
cmd.Parameters.Add("Identity", accountName);
|
||||||
|
result = ExecuteShellCommand(runSpace, cmd);
|
||||||
|
if ((result != null) & (result.Count > 0))
|
||||||
|
{
|
||||||
|
mailbox = result[0];
|
||||||
|
info.EnableLitigationHold = (bool)GetPSObjectProperty(mailbox, "InPlaceHoldEnabled");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//Statistics
|
//Statistics
|
||||||
cmd = new Command("Get-MailboxStatistics");
|
cmd = new Command("Get-MailboxStatistics");
|
||||||
cmd.Parameters.Add("Identity", accountName);
|
cmd.Parameters.Add("Identity", accountName);
|
||||||
|
@ -2558,9 +2589,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
cmd.Parameters.Add("MaxSendSize", ConvertKBToUnlimited(maxSendMessageSizeKB));
|
cmd.Parameters.Add("MaxSendSize", ConvertKBToUnlimited(maxSendMessageSizeKB));
|
||||||
cmd.Parameters.Add("MaxReceiveSize", ConvertKBToUnlimited(maxReceiveMessageSizeKB));
|
cmd.Parameters.Add("MaxReceiveSize", ConvertKBToUnlimited(maxReceiveMessageSizeKB));
|
||||||
|
|
||||||
cmd.Parameters.Add("LitigationHoldEnabled", enabledLitigationHold);
|
|
||||||
cmd.Parameters.Add("RecoverableItemsQuota", ConvertKBToUnlimited(recoverabelItemsSpace));
|
cmd.Parameters.Add("RecoverableItemsQuota", ConvertKBToUnlimited(recoverabelItemsSpace));
|
||||||
|
|
||||||
cmd.Parameters.Add("RetentionUrl", litigationHoldUrl);
|
cmd.Parameters.Add("RetentionUrl", litigationHoldUrl);
|
||||||
cmd.Parameters.Add("RetentionComment", litigationHoldMsg);
|
cmd.Parameters.Add("RetentionComment", litigationHoldMsg);
|
||||||
|
|
||||||
|
@ -2568,6 +2597,16 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
|
|
||||||
ExecuteShellCommand(runSpace, cmd);
|
ExecuteShellCommand(runSpace, cmd);
|
||||||
|
|
||||||
|
//LitigationHold
|
||||||
|
cmd = new Command("Get-MailboxSearch");
|
||||||
|
cmd.Parameters.Add("Identity", accountName);
|
||||||
|
Collection<PSObject> result = ExecuteShellCommand(runSpace, cmd);
|
||||||
|
cmd = new Command((result == null) || (result.Count == 0) ? "New-MailboxSearch" : "Set-MailboxSearch");
|
||||||
|
cmd.Parameters.Add((result == null) || (result.Count == 0) ? "Name" : "Identity", accountName);
|
||||||
|
cmd.Parameters.Add("InPlaceHoldEnabled", enabledLitigationHold);
|
||||||
|
cmd.Parameters.Add("SourceMailboxes", accountName);
|
||||||
|
ExecuteShellCommand(runSpace, cmd);
|
||||||
|
|
||||||
//Client Access
|
//Client Access
|
||||||
cmd = new Command("Set-CASMailbox");
|
cmd = new Command("Set-CASMailbox");
|
||||||
cmd.Parameters.Add("Identity", accountName);
|
cmd.Parameters.Add("Identity", accountName);
|
||||||
|
@ -2943,7 +2982,6 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
string path = AddADPrefix(dn);
|
string path = AddADPrefix(dn);
|
||||||
DirectoryEntry entry = GetADObject(path);
|
DirectoryEntry entry = GetADObject(path);
|
||||||
info.Enabled = !(bool)entry.InvokeGet("AccountDisabled");
|
info.Enabled = !(bool)entry.InvokeGet("AccountDisabled");
|
||||||
info.LitigationHoldEnabled = (bool)GetPSObjectProperty(mailbox, "LitigationHoldEnabled");
|
|
||||||
|
|
||||||
info.DisplayName = (string)GetPSObjectProperty(mailbox, "DisplayName");
|
info.DisplayName = (string)GetPSObjectProperty(mailbox, "DisplayName");
|
||||||
SmtpAddress smtpAddress = (SmtpAddress)GetPSObjectProperty(mailbox, "PrimarySmtpAddress");
|
SmtpAddress smtpAddress = (SmtpAddress)GetPSObjectProperty(mailbox, "PrimarySmtpAddress");
|
||||||
|
@ -2953,6 +2991,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
info.MaxSize = ConvertUnlimitedToBytes((Unlimited<ByteQuantifiedSize>)GetPSObjectProperty(mailbox, "ProhibitSendReceiveQuota"));
|
info.MaxSize = ConvertUnlimitedToBytes((Unlimited<ByteQuantifiedSize>)GetPSObjectProperty(mailbox, "ProhibitSendReceiveQuota"));
|
||||||
DateTime? whenCreated = (DateTime?)GetPSObjectProperty(mailbox, "WhenCreated");
|
DateTime? whenCreated = (DateTime?)GetPSObjectProperty(mailbox, "WhenCreated");
|
||||||
info.AccountCreated = ConvertNullableToDateTime(whenCreated);
|
info.AccountCreated = ConvertNullableToDateTime(whenCreated);
|
||||||
|
|
||||||
//Client Access
|
//Client Access
|
||||||
Command cmd = new Command("Get-CASMailbox");
|
Command cmd = new Command("Get-CASMailbox");
|
||||||
cmd.Parameters.Add("Identity", id);
|
cmd.Parameters.Add("Identity", id);
|
||||||
|
@ -2965,6 +3004,17 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
info.POPEnabled = (bool)GetPSObjectProperty(mailbox, "PopEnabled");
|
info.POPEnabled = (bool)GetPSObjectProperty(mailbox, "PopEnabled");
|
||||||
info.IMAPEnabled = (bool)GetPSObjectProperty(mailbox, "ImapEnabled");
|
info.IMAPEnabled = (bool)GetPSObjectProperty(mailbox, "ImapEnabled");
|
||||||
|
|
||||||
|
//Litigation Hold
|
||||||
|
info.LitigationHoldEnabled = false;
|
||||||
|
cmd = new Command("Get-MailboxSearch");
|
||||||
|
cmd.Parameters.Add("Identity", id);
|
||||||
|
result = ExecuteShellCommand(runSpace, cmd);
|
||||||
|
if ((result != null) & (result.Count > 0))
|
||||||
|
{
|
||||||
|
mailbox = result[0];
|
||||||
|
info.LitigationHoldEnabled = (bool)GetPSObjectProperty(mailbox, "InPlaceHoldEnabled");
|
||||||
|
}
|
||||||
|
|
||||||
//Statistics
|
//Statistics
|
||||||
cmd = new Command("Get-MailboxStatistics");
|
cmd = new Command("Get-MailboxStatistics");
|
||||||
cmd.Parameters.Add("Identity", id);
|
cmd.Parameters.Add("Identity", id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue