Ejemplo n.º 1
0
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            MailboxStatistics deletedStoreMailbox = MailboxTaskHelper.GetDeletedStoreMailbox(base.DataSession, this.Identity, this.RootId, this.Database, new Task.ErrorLoggerDelegate(base.WriteError));
            ADSessionSettings sessionSettings;

            if (deletedStoreMailbox.ExternalDirectoryOrganizationId == Guid.Empty)
            {
                sessionSettings = ADSessionSettings.FromRootOrgScopeSet();
            }
            else
            {
                sessionSettings = ADSessionSettings.FromExternalDirectoryOrganizationId(deletedStoreMailbox.ExternalDirectoryOrganizationId);
            }
            this.tenantConfigurationSession        = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(base.DomainController, false, ConsistencyMode.PartiallyConsistent, sessionSettings, 470, "PrepareDataObject", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\MapiTasks\\Mailbox\\ConnectMailbox.cs");
            this.recipientSession                  = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, false, ConsistencyMode.PartiallyConsistent, sessionSettings, 476, "PrepareDataObject", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\MapiTasks\\Mailbox\\ConnectMailbox.cs");
            this.recipientSession.UseGlobalCatalog = (base.ServerSettings.ViewEntireForest && null == base.DomainController);
            this.globalCatalogSession              = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, true, ConsistencyMode.PartiallyConsistent, sessionSettings, 486, "PrepareDataObject", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\MapiTasks\\Mailbox\\ConnectMailbox.cs");
            if (!this.globalCatalogSession.IsReadConnectionAvailable())
            {
                this.globalCatalogSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(ConsistencyMode.PartiallyConsistent, sessionSettings, 494, "PrepareDataObject", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\MapiTasks\\Mailbox\\ConnectMailbox.cs");
            }
            TaskLogger.LogExit();
            return(deletedStoreMailbox);
        }