protected override void InitializeRunspace(Runspace runspace) { base.InitializeRunspace(runspace); RunspaceServerSettings value = RunspaceServerSettings.CreateGcOnlyRunspaceServerSettings(this.affinityToken, false); runspace.SessionStateProxy.SetVariable(ExchangePropertyContainer.ADServerSettingsVarName, value); }
private ADServerSettings CreateServerSettingsForUserWithForestWideAffinity(string userIdentity, OrganizationId orgId) { if (string.IsNullOrEmpty(userIdentity) || orgId == null || ADSessionSettings.IsForefrontObject(orgId.PartitionId) || orgId.Equals(OrganizationId.ForestWideOrgId)) { return(null); } return(RunspaceServerSettings.CreateGcOnlyRunspaceServerSettings(RunspaceServerSettings.GetTokenForUser(userIdentity, orgId), orgId.PartitionId.ForestFQDN, true)); }
private ADServerSettings CreateServerSettings(OrganizationId orgId, bool useDCInAnySite) { if (orgId == null || ADSessionSettings.IsForefrontObject(orgId.PartitionId) || orgId.Equals(OrganizationId.ForestWideOrgId)) { return(null); } return(RunspaceServerSettings.CreateGcOnlyRunspaceServerSettings(RunspaceServerSettings.GetTokenForOrganization(orgId), orgId.PartitionId.ForestFQDN, useDCInAnySite)); }
internal override RunspaceServerSettings CreateRunspaceServerSettings() { string runspaceServerSettingsToken = this.GetRunspaceServerSettingsToken(); if (runspaceServerSettingsToken == null) { return(RunspaceServerSettings.CreateRunspaceServerSettings(false)); } OrganizationId organizationId = RbacPrincipal.Current.RbacConfiguration.OrganizationId; if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Eac.OrgIdADSeverSettings.Enabled&& organizationId != null && RbacPrincipal.Current.IsAdmin && !OrganizationId.ForestWideOrgId.Equals(organizationId) && !ADSessionSettings.IsForefrontObject(organizationId.PartitionId)) { return(RunspaceServerSettings.CreateGcOnlyRunspaceServerSettings(runspaceServerSettingsToken.ToLowerInvariant(), organizationId.PartitionId.ForestFQDN, false)); } return(RunspaceServerSettings.CreateGcOnlyRunspaceServerSettings(runspaceServerSettingsToken.ToLowerInvariant(), false)); }
// Token: 0x06000E81 RID: 3713 RVA: 0x00057330 File Offset: 0x00055530 protected override void InitializeRunspace(Runspace runspace) { base.InitializeRunspace(runspace); string token = (this.organizationId == OrganizationId.ForestWideOrgId) ? "RootOrg" : RunspaceServerSettings.GetTokenForOrganization(this.organizationId); RunspaceServerSettings runspaceServerSettings; if (this.organizationId != null && !this.organizationId.PartitionId.IsLocalForestPartition()) { runspaceServerSettings = RunspaceServerSettings.CreateGcOnlyRunspaceServerSettings(token, this.organizationId.PartitionId.ForestFQDN, false); runspaceServerSettings.RecipientViewRoot = ADSystemConfigurationSession.GetRootOrgContainerId(null, null).DomainId; } else { runspaceServerSettings = RunspaceServerSettings.CreateGcOnlyRunspaceServerSettings(token, false); } runspace.SessionStateProxy.SetVariable(ExchangePropertyContainer.ADServerSettingsVarName, runspaceServerSettings); }
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()); }
protected override ADServerSettings GetCmdletADServerSettings() { PropertyBag fields = base.CurrentTaskContext.InvocationInfo.Fields; SwitchParameter switchParameter = fields.Contains("IsDatacenter") ? ((SwitchParameter)fields["IsDatacenter"]) : new SwitchParameter(false); bool flag = fields.Contains("DomainController"); OrganizationIdParameter organizationIdParameter = (OrganizationIdParameter)fields["PrimaryOrganization"]; PartitionId partitionId = (organizationIdParameter != null) ? ADAccountPartitionLocator.GetPartitionIdByAcceptedDomainName(organizationIdParameter.RawIdentity) : null; string value = null; ADServerSettings serverSettings = ExchangePropertyContainer.GetServerSettings(base.CurrentTaskContext.SessionState); if (serverSettings != null && partitionId != null) { value = serverSettings.PreferredGlobalCatalog(partitionId.ForestFQDN); } if (switchParameter && organizationIdParameter != null && string.IsNullOrEmpty(value) && partitionId != null && !flag) { if (this.domainBasedADServerSettings == null) { this.domainBasedADServerSettings = RunspaceServerSettings.CreateGcOnlyRunspaceServerSettings(organizationIdParameter.RawIdentity.ToLowerInvariant(), partitionId.ForestFQDN, false); } return(this.domainBasedADServerSettings); } return(base.GetCmdletADServerSettings()); }