public override void ResolveServer(Server server) { bool flag = ServerComponentStates.IsServerOnline(server.ComponentStates); if (!flag || !server.IsHubTransportServer || (!server.IsE15OrLater && !this.cmdlet.IncludeE14Servers)) { return; } if (server.ServerSite != null) { this.serverToSiteMap[server.Id] = server.ServerSite; } if (server.DatabaseAvailabilityGroup != null || server.ServerSite != null) { GroupOfServersKey key = (server.DatabaseAvailabilityGroup != null) ? GroupOfServersKey.CreateFromDag(server.DatabaseAvailabilityGroup) : GroupOfServersKey.CreateFromSite(server.ServerSite, server.MajorVersion); if (!this.dagToServersMap.ContainsKey(key)) { this.dagToServersMap[key] = new HashSet <ADObjectId>(); } this.dagToServersMap[key].Add(server.Id); return; } this.serversNotBelongingToAnyDag.Add(server.Id); }
public TopologyServerInfo(Site site, TopologyServer server) { this.Site = site; this.DistinguishedName = server.DistinguishedName; this.ServerFullyQualifiedDomainName = server.Fqdn; this.VersionNumber = server.VersionNumber; this.AdminDisplayVersionNumber = server.AdminDisplayVersion; this.Role = server.CurrentServerRole; this.IsOutOfService = ((bool)server[ActiveDirectoryServerSchema.IsOutOfService] || !ServerComponentStates.IsServerOnline(server.ComponentStates)); }
// Token: 0x0600081D RID: 2077 RVA: 0x0002162C File Offset: 0x0001F82C private MiniServer GetActiveServer(ITopologyConfigurationSession configSession, ADObjectId serverId, bool skipForMaintenanceMode) { bool enabled = VariantConfiguration.InvariantNoFlightingSnapshot.Cafe.CheckServerLocatorServersForMaintenanceMode.Enabled; bool enabled2 = VariantConfiguration.InvariantNoFlightingSnapshot.Cafe.CheckServerOnlineForActiveServer.Enabled; ADPropertyDefinition[] properties; if (enabled) { properties = new ADPropertyDefinition[] { ActiveDirectoryServerSchema.DatabaseCopyAutoActivationPolicy, ServerSchema.ComponentStates, ActiveDirectoryServerSchema.DatabaseCopyActivationDisabledAndMoveNow }; } else if (enabled2) { properties = new ADPropertyDefinition[] { ActiveDirectoryServerSchema.DatabaseCopyAutoActivationPolicy, ServerSchema.ComponentStates }; } else { properties = new ADPropertyDefinition[] { ActiveDirectoryServerSchema.DatabaseCopyAutoActivationPolicy }; } MiniServer miniServer = configSession.ReadMiniServer(serverId, properties); if (miniServer == null) { this.Tracer.TraceDebug((long)this.GetHashCode(), "[MailboxServerLocator.GetActiveServer] return null. Server is NULL."); return(null); } if (skipForMaintenanceMode) { if (miniServer.DatabaseCopyAutoActivationPolicy == DatabaseCopyAutoActivationPolicyType.Blocked) { this.Tracer.TraceDebug <string, string>((long)this.GetHashCode(), "[MailboxServerLocator.GetActiveServer] return null. Server {0} DatabaseCopyAutoActivationPolicy {1}.", miniServer.ToString(), miniServer.DatabaseCopyAutoActivationPolicy.ToString()); return(null); } if (enabled && miniServer.DatabaseCopyActivationDisabledAndMoveNow) { this.Tracer.TraceDebug <MiniServer, bool>((long)this.GetHashCode(), "[MailboxServerLocator.GetActiveServer] return null. Server {0} DatabaseCopyActivationDisabledAndMoveNow is {1}.", miniServer, miniServer.DatabaseCopyActivationDisabledAndMoveNow); return(null); } if (enabled2 || enabled) { MultiValuedProperty <string> multiValuedProperty = (MultiValuedProperty <string>)miniServer[ServerSchema.ComponentStates]; if (!ServerComponentStates.IsServerOnline(multiValuedProperty)) { this.Tracer.TraceDebug <MiniServer, string>((long)this.GetHashCode(), "[MailboxServerLocator.GetActiveServer] return null. Server {0} ComponentStates {1}.", miniServer, (multiValuedProperty == null) ? "<NULL>" : string.Join(",", multiValuedProperty.ToArray())); return(null); } } } return(miniServer); }