Ejemplo n.º 1
0
 public PowerShellResults <RuleRow> SetObject(Identity identity, SetInboxRule properties)
 {
     properties.FaultIfNull();
     properties = (SetInboxRule)InboxRules.SanitizeIdentityParameter(properties);
     if (properties.Name != null)
     {
         properties.Name = base.GetUniqueRuleName(properties.Name, this.GetList(null, null).Output);
     }
     return(base.SetObject <InboxRule, SetInboxRule, RuleRow>("Set-InboxRule", identity, properties));
 }
Ejemplo n.º 2
0
        public PowerShellResults <RuleRow> NewObject(NewInboxRule properties)
        {
            properties.FaultIfNull();
            properties      = (NewInboxRule)InboxRules.SanitizeIdentityParameter(properties);
            properties.Name = base.GetUniqueRuleName(properties.Name, this.GetList(null, null).Output);
            PowerShellResults <RuleRow> powerShellResults = base.NewObject <RuleRow, NewInboxRule>("New-InboxRule", properties);

            powerShellResults.Output = null;
            return(powerShellResults);
        }
Ejemplo n.º 3
0
        private InboxRule GetMessageInfo(string messageId)
        {
            InboxRules inboxRules = base.RuleService as InboxRules;
            PowerShellResults <InboxRule> mailMessage = inboxRules.GetMailMessage(new NewInboxRule
            {
                FromMessageId = new Identity(messageId, messageId),
                ValidateOnly  = new bool?(true),
                AllowExceuteThruHttpGetRequest = true
            });

            if (mailMessage.Failed)
            {
                string cause = (mailMessage.ErrorRecords[0].Exception is ManagementObjectNotFoundException) ? "messagenotfound" : "unexpected";
                ErrorHandlingUtil.TransferToErrorPage(cause);
            }
            return(mailMessage.Value);
        }