fix wsp-10243 Exchange 2010 - Retention policy errors

This commit is contained in:
dev_amdtel 2014-05-29 03:38:34 +04:00
parent b820a28f85
commit 12b1a08168

View file

@ -3372,26 +3372,29 @@ namespace WebsitePanel.EnterpriseServer
ExchangeMailboxPlan policy = GetExchangeMailboxPlan(itemID, policyId);
List<ExchangeMailboxPlanRetentionPolicyTag> policytaglist = GetExchangeMailboxPlanRetentionPolicyTags(policyId);
List<string> tagLinks = new List<string>();
foreach (ExchangeMailboxPlanRetentionPolicyTag policytag in policytaglist)
if (policy != null)
{
ExchangeRetentionPolicyTag tag = GetExchangeRetentionPolicyTag(itemID, policytag.TagID);
tagLinks.Add(tag.WSPUniqueName);
List<ExchangeMailboxPlanRetentionPolicyTag> policytaglist = GetExchangeMailboxPlanRetentionPolicyTags(policyId);
// update PlanRetentionPolicyTags
List<string> tagLinks = new List<string>();
ResultObject resItem = exchange.SetRetentionPolicyTag(tag.WSPUniqueName, (ExchangeRetentionPolicyTagType)tag.TagType, tag.AgeLimitForRetention, (ExchangeRetentionPolicyTagAction)tag.RetentionAction);
result.ErrorCodes.AddRange(resItem.ErrorCodes);
result.IsSuccess = result.IsSuccess && resItem.IsSuccess;
foreach (ExchangeMailboxPlanRetentionPolicyTag policytag in policytaglist)
{
ExchangeRetentionPolicyTag tag = GetExchangeRetentionPolicyTag(itemID, policytag.TagID);
tagLinks.Add(tag.WSPUniqueName);
// update PlanRetentionPolicyTags
ResultObject resItem = exchange.SetRetentionPolicyTag(tag.WSPUniqueName, (ExchangeRetentionPolicyTagType)tag.TagType, tag.AgeLimitForRetention, (ExchangeRetentionPolicyTagAction)tag.RetentionAction);
result.ErrorCodes.AddRange(resItem.ErrorCodes);
result.IsSuccess = result.IsSuccess && resItem.IsSuccess;
}
ResultObject res = exchange.SetRetentionPolicy(policy.WSPUniqueName, tagLinks.ToArray());
result.ErrorCodes.AddRange(res.ErrorCodes);
result.IsSuccess = result.IsSuccess && res.IsSuccess;
}
ResultObject res = exchange.SetRetentionPolicy(policy.WSPUniqueName, tagLinks.ToArray());
result.ErrorCodes.AddRange(res.ErrorCodes);
result.IsSuccess = result.IsSuccess && res.IsSuccess;
}
}