private void TryCallE14()
 {
     if (this.ownerServer != null && this.ownerServer.VersionNumber < Server.E15MinVersion)
     {
         string name = this.ownerServer.Name;
         string text = null;
         try
         {
             TriggerPrivateRpcClient triggerPrivateRpcClient = new TriggerPrivateRpcClient(name);
             triggerPrivateRpcClient.RunOabGenTask(((ADObjectId)this.DataObject.Identity).DistinguishedName);
         }
         catch (RpcException ex)
         {
             text = RpcUtility.MapRpcErrorCodeToMessage(ex.ErrorCode, name);
         }
         catch (COMException ex2)
         {
             text = ex2.Message;
         }
         if (text != null)
         {
             base.WriteError(new LocalizedException(Strings.ErrorOabGenFailedE14(this.DataObject.Identity.ToString(), name, text)), ErrorCategory.InvalidResult, this.Identity);
         }
     }
 }
示例#2
0
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter();
            ELCTaskHelper.VerifyIsInConfigScopes(this.DataObject, base.SessionSettings, new Task.TaskErrorLoggingDelegate(base.WriteError));
            string fqdn = this.DataObject.Fqdn;
            AssistantsRpcClient assistantsRpcClient = new AssistantsRpcClient(fqdn);
            int num = 3;

            try
            {
IL_37:
                assistantsRpcClient.Stop("ElcAssistant");
            }
            catch (RpcException ex)
            {
                num--;
                if ((ex.ErrorCode == 1753 || ex.ErrorCode == 1727) && num > 0)
                {
                    goto IL_37;
                }
                base.WriteError(new TaskException(RpcUtility.MapRpcErrorCodeToMessage(ex.ErrorCode, fqdn)), ErrorCategory.InvalidOperation, null);
                goto IL_37;
            }
            TaskLogger.LogExit();
        }
示例#3
0
        private void InternalProcessOneRequest(AssistantsRpcClient client, string serverName, Guid mailboxGuid, Guid mdbGuid)
        {
            int num = 3;

            try
            {
IL_02:
                client.StartWithParams("ElcAssistant", mailboxGuid, mdbGuid, this.GetElcParameters().ToString());
            }
            catch (RpcException ex)
            {
                num--;
                if ((ex.ErrorCode == 1753 || ex.ErrorCode == 1727) && num > 0)
                {
                    goto IL_02;
                }
                base.WriteError(new TaskException(RpcUtility.MapRpcErrorCodeToMessage(ex.ErrorCode, serverName)), ErrorCategory.InvalidOperation, null);
                goto IL_02;
            }
        }
        private void TryCallE15()
        {
            ADUser[] array = null;
            if (OABVariantConfigurationSettings.IsLinkedOABGenMailboxesEnabled)
            {
                ADObjectId generatingMailbox = this.DataObject.GeneratingMailbox;
                if (generatingMailbox != null)
                {
                    ADUser aduser = (ADUser)base.GetDataObject <ADUser>(new MailboxIdParameter(generatingMailbox), base.TenantGlobalCatalogSession, null, new LocalizedString?(Strings.ErrorMailboxAddressNotFound(generatingMailbox.ToString())), new LocalizedString?(Strings.ErrorMailboxAddressNotUnique(generatingMailbox.ToString())));
                    array = new ADUser[]
                    {
                        aduser
                    };
                }
            }
            if (array == null)
            {
                array = OrganizationMailbox.FindByOrganizationId(this.DataObject.OrganizationId, OrganizationCapability.OABGen);
                if (array.Length == 0)
                {
                    if (this.ownerServer != null && this.ownerServer.VersionNumber >= Server.E15MinVersion)
                    {
                        base.WriteError(new LocalizedException(Strings.ErrorOabGenFailedSinceNoOrgMbxFound(this.DataObject.Identity.ToString())), ErrorCategory.ObjectNotFound, this.Identity);
                    }
                    return;
                }
            }
            bool flag = false;

            foreach (ADUser aduser2 in array)
            {
                string activeServerFqdn = OrganizationMailbox.GetActiveServerFqdn(aduser2.Id);
                string text             = null;
                try
                {
                    OABGeneratorAssistantRunNowParameters oabgeneratorAssistantRunNowParameters = new OABGeneratorAssistantRunNowParameters
                    {
                        PartitionId = this.DataObject.Id.GetPartitionId(),
                        ObjectGuid  = this.DataObject.Id.ObjectGuid,
                        Description = "from Update-OAB on Server:" + Environment.MachineName
                    };
                    AssistantsRpcClient assistantsRpcClient = new AssistantsRpcClient(activeServerFqdn);
                    assistantsRpcClient.StartWithParams("OABGeneratorAssistant", aduser2.ExchangeGuid, aduser2.Database.ObjectGuid, oabgeneratorAssistantRunNowParameters.ToString());
                    flag = true;
                }
                catch (RpcException ex)
                {
                    text = RpcUtility.MapRpcErrorCodeToMessage(ex.ErrorCode, activeServerFqdn);
                }
                catch (COMException ex2)
                {
                    text = ex2.Message;
                }
                if (text != null)
                {
                    if (array.Length == 1)
                    {
                        base.WriteError(new LocalizedException(Strings.ErrorOabGenFailed(this.DataObject.Identity.ToString(), activeServerFqdn, text)), ErrorCategory.InvalidResult, this.Identity);
                    }
                    else
                    {
                        this.WriteWarning(Strings.WarningOabGenFailed(this.DataObject.Identity.ToString(), aduser2.Identity.ToString(), activeServerFqdn, text));
                    }
                }
            }
            if (array.Length > 1 && !flag)
            {
                base.WriteError(new LocalizedException(Strings.ErrorOabGenFailedForAllOrgMailboxes(this.DataObject.Identity.ToString())), ErrorCategory.InvalidResult, this.Identity);
            }
        }