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); }
internal void RebindDataSessionToDataObjectPartitionRidMasterIncludeRetiredTenants(PartitionId partitionId) { string ridMasterName = ForestTenantRelocationsCache.GetRidMasterName(partitionId); if (this.DomainController != null) { string value = this.DomainController.ToString().Split(new char[] { '.' })[0] + "."; if (!ridMasterName.StartsWith(value, StringComparison.OrdinalIgnoreCase)) { ForestTenantRelocationsCache.Reset(); base.WriteError(new InvalidOperationException(Strings.ErrorMustWriteToRidMaster(ridMasterName)), ErrorCategory.InvalidOperation, ridMasterName); } } ADSessionSettings adsessionSettings = ADSessionSettings.FromAllTenantsPartitionId(partitionId); adsessionSettings.TenantConsistencyMode = TenantConsistencyMode.IncludeRetiredTenants; adsessionSettings.RetiredTenantModificationAllowed = true; this.dataSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession(ridMasterName, false, ConsistencyMode.PartiallyConsistent, adsessionSettings, 1125, "RebindDataSessionToDataObjectPartitionRidMasterIncludeRetiredTenants", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\DataAccessTask.cs"); }