Esempio n. 1
0
        protected override IConfigDataProvider CreateSession()
        {
            ADSessionSettings adsessionSettings;

            if (this.AccountPartition != null)
            {
                PartitionId partitionId = RecipientTaskHelper.ResolvePartitionId(this.AccountPartition, new Task.TaskErrorLoggingDelegate(base.WriteError));
                adsessionSettings = ADSessionSettings.FromAllTenantsPartitionId(partitionId);
            }
            else
            {
                adsessionSettings = ADSessionSettings.FromCustomScopeSet(base.ScopeSet, base.RootOrgContainerId, base.CurrentOrganizationId, base.ExecutingUserOrganizationId, true);
            }
            if (MapiTaskHelper.IsDatacenter || MapiTaskHelper.IsDatacenterDedicated)
            {
                adsessionSettings.IncludeSoftDeletedObjects = true;
                adsessionSettings.IncludeInactiveMailbox    = true;
            }
            this.CurrentOrgConfigSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(this.DomainController, true, ConsistencyMode.PartiallyConsistent, null, adsessionSettings, 479, "CreateSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\MailboxReplication\\RequestBase\\GetRequest.cs");
            if (this.AccountPartition == null)
            {
                adsessionSettings = ADSessionSettings.RescopeToSubtree(adsessionSettings);
            }
            this.GCSession     = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(this.DomainController, true, ConsistencyMode.PartiallyConsistent, adsessionSettings, 493, "CreateSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\MailboxReplication\\RequestBase\\GetRequest.cs");
            this.RecipSession  = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(this.DomainController, true, ConsistencyMode.PartiallyConsistent, adsessionSettings, 500, "CreateSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\MailboxReplication\\RequestBase\\GetRequest.cs");
            this.ConfigSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(null, true, ConsistencyMode.PartiallyConsistent, null, ADSessionSettings.FromRootOrgScopeSet(), 506, "CreateSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\MailboxReplication\\RequestBase\\GetRequest.cs");
            if (this.indexProvider != null)
            {
                this.indexProvider = null;
            }
            this.indexProvider = new RequestIndexEntryProvider(this.GCSession, this.CurrentOrgConfigSession);
            return(this.indexProvider);
        }
Esempio n. 2
0
        protected override IConfigDataProvider CreateSession()
        {
            if (this.AccountPartition == null && this.Identity == null)
            {
                base.WriteError(new NotSupportedException(Strings.ErrorUnknownPartition), ErrorCategory.InvalidData, null);
            }
            PartitionId partitionId;

            if (this.Identity != null)
            {
                if (this.Identity.RawIdentity.Contains("*"))
                {
                    base.WriteError(new ArgumentException(Strings.ErrorWildcardNotSupportedInRelocationIdentity(this.Identity.RawIdentity)), ErrorCategory.InvalidOperation, this.Identity);
                }
                OrganizationId organizationId = this.Identity.ResolveOrganizationId();
                partitionId = organizationId.PartitionId;
            }
            else
            {
                partitionId = RecipientTaskHelper.ResolvePartitionId(this.AccountPartition, new Task.TaskErrorLoggingDelegate(base.WriteError));
            }
            this.sourceForestRIDMaster = ForestTenantRelocationsCache.GetRidMasterName(partitionId);
            ITenantConfigurationSession tenantConfigurationSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession(base.DomainController, true, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromAllTenantsPartitionId(partitionId), 223, "CreateSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Relocation\\GetTenantRelocationRequest.cs");

            if (base.DomainController != null && !this.sourceForestRIDMaster.StartsWith(base.DomainController, StringComparison.OrdinalIgnoreCase))
            {
                ForestTenantRelocationsCache.Reset();
            }
            tenantConfigurationSession.SessionSettings.TenantConsistencyMode = TenantConsistencyMode.IncludeRetiredTenants;
            return(tenantConfigurationSession);
        }
 protected override void InternalValidate()
 {
     base.InternalValidate();
     if (this.AccountPartition != null)
     {
         this.accountPartitionId = RecipientTaskHelper.ResolvePartitionId(this.AccountPartition, new Task.TaskErrorLoggingDelegate(base.WriteError));
     }
 }
 // Token: 0x060005E0 RID: 1504 RVA: 0x0001657C File Offset: 0x0001477C
 protected override void InternalStateReset()
 {
     if (this.AccountPartition != null)
     {
         PartitionId partitionId = RecipientTaskHelper.ResolvePartitionId(this.AccountPartition, new Task.TaskErrorLoggingDelegate(base.WriteError));
         this.sessionSettings = ADSessionSettings.FromAccountPartitionRootOrgScopeSet(partitionId);
     }
     else
     {
         this.sessionSettings = ADSessionSettings.FromCustomScopeSet(base.ScopeSet, base.RootOrgContainerId, base.CurrentOrganizationId, base.ExecutingUserOrganizationId, true);
     }
     base.InternalStateReset();
 }
Esempio n. 5
0
 protected override void InternalValidate()
 {
     base.InternalValidate();
     if (this.AccountPartition != null)
     {
         PartitionId partitionId;
         Guid        guid;
         if (ADAccountPartitionLocator.IsSingleForestTopology(out partitionId) && Guid.TryParse(this.AccountPartition.RawIdentity, out guid) && guid.Equals(ADObjectId.ResourcePartitionGuid))
         {
             this.accountPartitionId = partitionId;
         }
         if (null == this.accountPartitionId)
         {
             this.accountPartitionId = RecipientTaskHelper.ResolvePartitionId(this.AccountPartition, new Task.TaskErrorLoggingDelegate(base.WriteError));
         }
     }
 }
        protected override void InternalStateReset()
        {
            TaskLogger.LogEnter();
            base.InternalStateReset();
            ADSessionSettings sessionSettings;

            if (this.AccountPartition != null)
            {
                PartitionId partitionId = RecipientTaskHelper.ResolvePartitionId(this.AccountPartition, new Task.TaskErrorLoggingDelegate(base.WriteError));
                sessionSettings = ADSessionSettings.FromAccountPartitionRootOrgScopeSet(partitionId);
            }
            else
            {
                sessionSettings = ADSessionSettings.RescopeToSubtree(base.OrgWideSessionSettings);
            }
            this.recipientSession             = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, false, ConsistencyMode.PartiallyConsistent, sessionSettings, 176, "InternalStateReset", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\SystemConfigurationTasks\\organization\\SetOrganization.cs");
            this.recipientSession.UseConfigNC = true;
            TaskLogger.LogExit();
        }
Esempio n. 7
0
        protected override void InternalStateReset()
        {
            this.accountPartition = null;
            if (this.AccountPartition != null)
            {
                this.accountPartition = RecipientTaskHelper.ResolvePartitionId(this.AccountPartition, new Task.TaskErrorLoggingDelegate(base.WriteError));
            }
            PartitionId partitionId;

            if (this.RequestForMultipleOrgs() && this.accountPartition == null && ADAccountPartitionLocator.IsSingleForestTopology(out partitionId))
            {
                this.accountPartition = partitionId;
                this.WriteWarning(Strings.ImplicitPartitionIdSupplied(this.accountPartition.ToString()));
            }
            if (this.Identity != null)
            {
                this.Identity.AccountPartition = this.accountPartition;
            }
            base.InternalStateReset();
        }
Esempio n. 8
0
        protected override ADServerSettings GetCmdletADServerSettings()
        {
            this.fields = base.CurrentTaskContext.InvocationInfo.Fields;
            SwitchParameter switchParameter = this.fields.Contains("IsDatacenter") ? ((SwitchParameter)this.fields["IsDatacenter"]) : new SwitchParameter(false);

            if (!this.fields.Contains(ManageOrganizationTaskBase.ParameterCreateSharedConfig))
            {
                new SwitchParameter(false);
            }
            else
            {
                SwitchParameter switchParameter2 = (SwitchParameter)this.fields[ManageOrganizationTaskBase.ParameterCreateSharedConfig];
            }
            string text  = (string)this.fields["TenantProgramId"];
            string text2 = (string)this.fields["TenantOfferId"];
            AccountPartitionIdParameter accountPartitionIdParameter = (AccountPartitionIdParameter)this.fields["AccountPartition"];
            string value = null;

            if (TopologyProvider.CurrentTopologyMode == TopologyMode.ADTopologyService && switchParameter)
            {
                ADServerSettings serverSettings = ExchangePropertyContainer.GetServerSettings(base.CurrentTaskContext.SessionState);
                if (serverSettings != null && accountPartitionIdParameter != null)
                {
                    PartitionId partitionId = RecipientTaskHelper.ResolvePartitionId(accountPartitionIdParameter, null);
                    if (partitionId != null)
                    {
                        value = serverSettings.PreferredGlobalCatalog(partitionId.ForestFQDN);
                    }
                }
                if (string.IsNullOrEmpty(value) && this.Name != null)
                {
                    if (this.domainBasedADServerSettings == null)
                    {
                        PartitionId partitionId2 = (accountPartitionIdParameter == null) ? PartitionId.LocalForest : RecipientTaskHelper.ResolvePartitionId(accountPartitionIdParameter, null);
                        this.domainBasedADServerSettings = RunspaceServerSettings.CreateGcOnlyRunspaceServerSettings(this.Name.ToLowerInvariant(), partitionId2.ForestFQDN, false);
                    }
                    return(this.domainBasedADServerSettings);
                }
            }
            return(base.GetCmdletADServerSettings());
        }
Esempio n. 9
0
        protected override void WriteResult(IConfigurable dataObject)
        {
            TaskLogger.LogEnter(new object[]
            {
                dataObject.Identity,
                dataObject
            });
            ADOrganizationConfig adorganizationConfig = dataObject as ADOrganizationConfig;

            if (adorganizationConfig != null)
            {
                int?num = this.RetrieveSCLJunkThreshold(adorganizationConfig.Id);
                if (num != null)
                {
                    adorganizationConfig.SCLJunkThreshold = num.Value;
                }
                this.FillTaskPopulatedFields(adorganizationConfig);
                MultiValuedProperty <OrganizationSummaryEntry> multiValuedProperty = new MultiValuedProperty <OrganizationSummaryEntry>();
                foreach (OrganizationSummaryEntry organizationSummaryEntry in adorganizationConfig.OrganizationSummary)
                {
                    if (OrganizationSummaryEntry.IsValidKeyForCurrentRelease(organizationSummaryEntry.Key))
                    {
                        multiValuedProperty.Add(organizationSummaryEntry.Clone());
                    }
                }
                multiValuedProperty.ResetChangeTracking();
                adorganizationConfig.OrganizationSummary = multiValuedProperty;
                adorganizationConfig.ResetChangeTracking();
            }
            ADSessionSettings sessionSettings;

            if (this.AccountPartition == null)
            {
                sessionSettings = ADSessionSettings.RescopeToSubtree(base.OrgWideSessionSettings);
            }
            else
            {
                PartitionId partitionId = RecipientTaskHelper.ResolvePartitionId(this.AccountPartition, new Task.TaskErrorLoggingDelegate(base.WriteError));
                sessionSettings = ADSessionSettings.FromAccountPartitionRootOrgScopeSet(partitionId);
            }
            IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, false, ConsistencyMode.PartiallyConsistent, sessionSettings, 109, "WriteResult", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\SystemConfigurationTasks\\organization\\GetOrganization.cs");

            tenantOrRootOrgRecipientSession.UseConfigNC = true;
            ADMicrosoftExchangeRecipient admicrosoftExchangeRecipient = MailboxTaskHelper.FindMicrosoftExchangeRecipient(tenantOrRootOrgRecipientSession, (IConfigurationSession)base.DataSession);

            if (admicrosoftExchangeRecipient == null)
            {
                if (adorganizationConfig.SharedConfigurationInfo == null)
                {
                    if (!this.IsOnlyGatewayServerRoleExist())
                    {
                        this.WriteError(new InvalidOperationException(Strings.ErrorMicrosoftExchangeRecipientNotFound), ErrorCategory.ReadError, adorganizationConfig.Identity, false);
                    }
                    else
                    {
                        base.WriteVerbose(Strings.MicrosoftExchangeRecipientNotFoundOnGatewayServerRole);
                    }
                }
            }
            else
            {
                ValidationError[] array = admicrosoftExchangeRecipient.Validate();
                for (int i = 0; i < array.Length; i++)
                {
                    this.WriteWarning(array[i].Description);
                }
                adorganizationConfig.MicrosoftExchangeRecipientEmailAddresses            = admicrosoftExchangeRecipient.EmailAddresses;
                adorganizationConfig.MicrosoftExchangeRecipientReplyRecipient            = admicrosoftExchangeRecipient.ForwardingAddress;
                adorganizationConfig.MicrosoftExchangeRecipientEmailAddressPolicyEnabled = admicrosoftExchangeRecipient.EmailAddressPolicyEnabled;
                adorganizationConfig.MicrosoftExchangeRecipientPrimarySmtpAddress        = admicrosoftExchangeRecipient.PrimarySmtpAddress;
                adorganizationConfig.ResetChangeTracking();
            }
            bool flag = !OrganizationId.ForestWideOrgId.Equals(adorganizationConfig.OrganizationId);

            if (flag)
            {
                MultiValuedProperty <string> multiValuedProperty2 = this.AcceptedDomainNamesGetter(adorganizationConfig);
                if (multiValuedProperty2 != null)
                {
                    adorganizationConfig.AcceptedDomainNames = multiValuedProperty2;
                }
            }
            if (VariantConfiguration.InvariantNoFlightingSnapshot.Global.MultiTenancy.Enabled)
            {
                adorganizationConfig.HierarchicalAddressBookRoot = this.GetHierarchicalAddressBookRootFromOU(adorganizationConfig.OrganizationId.OrganizationalUnit);
            }
            base.WriteResult(new OrganizationConfig(adorganizationConfig, flag));
            TaskLogger.LogExit();
        }