// Token: 0x060007E5 RID: 2021 RVA: 0x0001D098 File Offset: 0x0001B298
 public AccountPartitionIdParameter(Fqdn fqdn) : base((fqdn == null) ? null : fqdn.ToString())
 {
     if (fqdn == null)
     {
         throw new ArgumentNullException("fqdn");
     }
     this.fqdn = fqdn;
 }
示例#2
0
 public MapiSession(string serverExchangeLegacyDn, Fqdn serverFqdn, ConsistencyMode consistencyMode)
 {
     this.serverName             = serverFqdn.ToString().ToLowerInvariant();
     this.serverExchangeLegacyDn = serverExchangeLegacyDn.ToLowerInvariant();
     this.consistencyMode        = consistencyMode;
     this.disposeTracker         = this.GetDisposeTracker();
     this.disposed = false;
 }
示例#3
0
 public void RedirectServer(string serverExchangeLegacyDn, Fqdn serverFqdn)
 {
     if (string.Equals(this.serverExchangeLegacyDn, serverExchangeLegacyDn, StringComparison.OrdinalIgnoreCase))
     {
         return;
     }
     this.ReturnBackConnections();
     this.serverName             = serverFqdn.ToString().ToLowerInvariant();
     this.serverExchangeLegacyDn = serverExchangeLegacyDn.ToLowerInvariant();
 }
        public ServerPerformanceObject(Fqdn identity)
        {
            string key = identity.ToString().ToLower();

            lock (ServerPerformanceObject.latencyDetectionContextFactoriesLock)
            {
                if (!ServerPerformanceObject.latencyDetectionContextFactories.TryGetValue(key, out this.latencyDetectionContextFactory))
                {
                    this.latencyDetectionContextFactory = LatencyDetectionContextFactory.CreateFactory(identity);
                    ServerPerformanceObject.latencyDetectionContextFactories[key] = this.latencyDetectionContextFactory;
                }
            }
        }
示例#5
0
        public static string GetCurrentConfigDC(string partitionFqdn)
        {
            ADSessionSettings adsessionSettings;

            if (PartitionId.IsLocalForestPartition(partitionFqdn))
            {
                adsessionSettings = ADSessionSettings.FromRootOrgScopeSet();
            }
            else
            {
                adsessionSettings = ADSessionSettings.FromAccountPartitionRootOrgScopeSet(new PartitionId(partitionFqdn));
            }
            Fqdn fqdn = adsessionSettings.ServerSettings.ConfigurationDomainController(partitionFqdn);

            if (fqdn != null)
            {
                return(fqdn.ToString());
            }
            return(TopologyProvider.GetInstance().GetConfigDC(partitionFqdn));
        }
示例#6
0
 // Token: 0x06000523 RID: 1315 RVA: 0x0001D4C0 File Offset: 0x0001B6C0
 internal bool IsServerKnown(Fqdn serverFqdn)
 {
     return((this.configDC != null && this.configDC.Fqdn.Equals(serverFqdn.ToString(), StringComparison.OrdinalIgnoreCase)) || this.inForestGCs.ContainsKey(serverFqdn.ToString()) || this.inSiteGCs.ContainsKey(serverFqdn.ToString()) || this.outOfSiteGCs.ContainsKey(serverFqdn.ToString()));
 }
 // Token: 0x060008BA RID: 2234 RVA: 0x0001EBBB File Offset: 0x0001CDBB
 public ClientAccessArrayIdParameter(Fqdn fqdn) : this(fqdn.ToString())
 {
 }
 public static Uri GetRemotePowerShellUri(Fqdn server)
 {
     if (server == null)
     {
         return(null);
     }
     return(new Uri(string.Format(PSConnectionInfoSingleton.RemotePowerShellUrlFormat, server.ToString())));
 }
 // Token: 0x060008C7 RID: 2247 RVA: 0x0001ECFF File Offset: 0x0001CEFF
 public ServerIdParameter(Fqdn fqdn) : this(fqdn.ToString())
 {
 }
        internal static void DoubleWrite <TDataObject>(ObjectId objectId, TDataObject scratchPad, string ownerServerName, Fqdn domainController, Task.TaskVerboseLoggingDelegate writeVerbose, Task.TaskWarningLoggingDelegate writeWarning) where TDataObject : ADConfigurationObject, new()
        {
            string configDC;

            try
            {
                writeVerbose(Strings.VerboseGetStoreConfigDCName(ownerServerName));
                configDC = ADSession.GetConfigDC(TopologyProvider.LocalForestFqdn, ownerServerName);
            }
            catch (ADTransientException ex)
            {
                writeWarning(Strings.VerboseFailedDoubleWriteOperation(ex.Message));
                TaskLogger.Trace("Failed to get the domain controller which store is using: {0}.", new object[]
                {
                    ex.Message
                });
                return;
            }
            if (domainController == null || !domainController.ToString().Equals(configDC, StringComparison.InvariantCultureIgnoreCase))
            {
                IConfigurationSession configurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(configDC, false, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 416, "DoubleWrite", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\SystemConfigurationTasks\\common\\SystemConfigurationCommon.cs");
                writeVerbose(TaskVerboseStringHelper.GetReadObjectVerboseString(objectId, configurationSession, typeof(TDataObject)));
                try
                {
                    TDataObject tdataObject = configurationSession.Read <TDataObject>((ADObjectId)objectId);
                    writeVerbose(TaskVerboseStringHelper.GetSourceVerboseString(configurationSession));
                    if (tdataObject == null)
                    {
                        writeVerbose(Strings.VerboseFailedReadObjectFromDC(objectId.ToString(), typeof(TDataObject).Name, configDC));
                        TaskLogger.Trace("Failed to read the data object from config DC: \"{0}\"", new object[]
                        {
                            configDC
                        });
                        TaskLogger.LogExit();
                        return;
                    }
                    tdataObject.CopyChangesFrom(scratchPad);
                    writeVerbose(Strings.VerboseDoubleWriteADChangeOnDC(objectId.ToString(), configDC));
                    configurationSession.Save(tdataObject);
                }
                catch (DataValidationException ex2)
                {
                    writeWarning(Strings.VerboseFailedDoubleWriteOperation(ex2.Message));
                    TaskLogger.Trace("Double write failed on DC '{0}': {1}", new object[]
                    {
                        configDC,
                        ex2.ToString()
                    });
                }
                catch (ADOperationException ex3)
                {
                    writeWarning(Strings.VerboseFailedDoubleWriteOperation(ex3.Message));
                    TaskLogger.Trace("Double write failed on DC '{0}': {1}", new object[]
                    {
                        configDC,
                        ex3.ToString()
                    });
                }
                catch (DataSourceTransientException ex4)
                {
                    writeWarning(Strings.VerboseFailedDoubleWriteOperation(ex4.Message));
                    TaskLogger.Trace("Double write failed on DC '{0}': {1}", new object[]
                    {
                        configDC,
                        ex4.ToString()
                    });
                }
                finally
                {
                    writeVerbose(TaskVerboseStringHelper.GetSourceVerboseString(configurationSession));
                }
            }
            TaskLogger.LogExit();
        }
示例#11
0
        internal static ADDomainTrustInfo ResolveAndValidateForestTrustForADDomain(Fqdn domainFqdn, Task.ErrorLoggerDelegate errorDelegate, IConfigurationSession configSession)
        {
            if (domainFqdn == null)
            {
                throw new ArgumentNullException("domainFqdn");
            }
            if (errorDelegate == null)
            {
                throw new ArgumentNullException("errorDelegate");
            }
            if (configSession == null)
            {
                throw new ArgumentNullException("configSession");
            }
            ADForest localForest = ADForest.GetLocalForest();

            ADDomainTrustInfo[] array = localForest.FindTrustRelationshipsForDomain(domainFqdn);
            if (array == null || array.Length == 0)
            {
                errorDelegate(new ManagementObjectNotFoundException(Strings.ErrorManagementObjectNotFound(domainFqdn.ToString())), ExchangeErrorCategory.Client, null);
            }
            else if (array.Length != 1)
            {
                errorDelegate(new ManagementObjectAmbiguousException(Strings.ErrorManagementObjectAmbiguous(domainFqdn.ToString())), ExchangeErrorCategory.Client, null);
            }
            ADDomainTrustInfo addomainTrustInfo = array[0];

            AccountPartition[] array2 = configSession.Find <AccountPartition>(configSession.GetOrgContainerId().GetChildId(AccountPartition.AccountForestContainerName), QueryScope.OneLevel, new ComparisonFilter(ComparisonOperator.Equal, AccountPartitionSchema.TrustedDomainLink, addomainTrustInfo.DistinguishedName), null, 1);
            if (array2 != null && array2.Length != 0)
            {
                errorDelegate(new LocalizedException(Strings.ErrorTrustAlreadyInUse(addomainTrustInfo.Name, array2[0].Name)), ExchangeErrorCategory.Client, null);
            }
            return(addomainTrustInfo);
        }
 public override Server FindServerByFqdn(Fqdn fqdn)
 {
     return(this.ConfigurationSession.FindServerByFqdn(fqdn.ToString()));
 }