API Reference
ReplicationService
Collects replication status and builds summaries using DirectoryServices.ActiveDirectory and LDAP (no shell out).
Inheritance
- Object
- ReplicationService
Methods
public static IReadOnlyList<ReplicationStatus> GetAll(Boolean includeEventLogs = false, Boolean outbound = false) #IReadOnlyList<ReplicationStatus>Returns replication status for all domain controllers in the current forest.
Parameters
- includeEventLogs System.Boolean = false
- outbound System.Boolean = false
public static IReadOnlyList<ReplicationStatus> GetAll(ReplicationQueryOptions options) #IReadOnlyList<ReplicationStatus>Returns replication status for all domain controllers in the current forest with options.
Parameters
- options ADPlayground.Replication.ReplicationQueryOptions
public static IReadOnlyList<ReplicationStatus> GetForDomain(String domainName, Boolean includeEventLogs = false, Boolean outbound = false) #IReadOnlyList<ReplicationStatus>Returns replication status for all domain controllers in a given domain.
Parameters
- domainName System.String
- includeEventLogs System.Boolean = false
- outbound System.Boolean = false
public static IReadOnlyList<ReplicationStatus> GetForDomain(String domainName, ReplicationQueryOptions options) #IReadOnlyList<ReplicationStatus>Returns replication status for all domain controllers in a given domain using advanced options (credentials, direction, filtering).
Parameters
- domainName System.String
- DNS domain name to query.
- options ADPlayground.Replication.ReplicationQueryOptions
- Replication query options controlling scope, credentials, and direction.
Returns
Replication status rows for the specified domain.
public static ReplicationForestStats GetForestStats(Boolean bySource, TimeSpan staleThreshold) #ReplicationForestStatsComputes forest-wide replication health statistics grouped by destination or source.
Parameters
- bySource System.Boolean
- When true, aggregate by source server; otherwise by destination.
- staleThreshold System.TimeSpan
- Threshold used to classify stale neighbors.
public static ReplicationForestStats GetForestStats(ReplicationQueryOptions options, Boolean bySource, TimeSpan staleThreshold) #ReplicationForestStatsComputes replication health statistics for a single domain grouped by destination or source.
Parameters
- domainName System.String
- DNS domain name to filter.
- bySource System.Boolean
- When true, aggregate by source server; otherwise by destination.
- staleThreshold System.TimeSpan
- Threshold used to classify stale neighbors.
GetForestStats(ADPlayground.Replication.ReplicationQueryOptions options, System.Boolean bySource, System.TimeSpan staleThreshold) #Computes forest-wide replication health statistics using query options.
Parameters
- options ADPlayground.Replication.ReplicationQueryOptions
- Query options controlling scope and data source.
- bySource System.Boolean
- When true, aggregate by source server; otherwise by destination.
- staleThreshold System.TimeSpan
- Threshold used to classify stale neighbors.
public static ReplicationForestStatsEx GetForestStatsEx(Boolean bySource, Int32[] bucketHours) #ReplicationForestStatsExComputes histogram-based forest health metrics using custom delta buckets (hours since last success).
Parameters
- bySource System.Boolean
- When true, aggregate by source server; otherwise by destination.
- bucketHours System.Int32[]
- Bucket thresholds in hours (e.g., 1, 3, 6, 12, 24).
public static ReplicationForestStatsEx GetForestStatsEx(ReplicationQueryOptions options, Boolean bySource, Int32[] bucketHours) #ReplicationForestStatsExComputes histogram-based health metrics for a single domain using custom delta buckets.
Parameters
- domainName System.String
- DNS domain name to filter.
- bySource System.Boolean
- When true, aggregate by source server; otherwise by destination.
- bucketHours System.Int32[]
- Bucket thresholds in hours.
GetForestStatsEx(ADPlayground.Replication.ReplicationQueryOptions options, System.Boolean bySource, System.Int32[] bucketHours) #Computes histogram-based health metrics using query options and custom delta buckets.
Parameters
- options ADPlayground.Replication.ReplicationQueryOptions
- Query options controlling scope and data source.
- bySource System.Boolean
- When true, aggregate by source server; otherwise by destination.
- bucketHours System.Int32[]
- Bucket thresholds in hours.
public static ReplicationForestStatsEx GetForestStatsExFromRaw(IReadOnlyList<ReplicationStatus> raw, Boolean bySource, Int32[] bucketHours) #ReplicationForestStatsExComputes histogram-based forest health metrics from pre-fetched raw replication rows.
Parameters
- raw System.Collections.Generic.IReadOnlyList{ADPlayground.Replication.ReplicationStatus}
- bySource System.Boolean
- bucketHours System.Int32[]
public static ReplicationForestStats GetForestStatsFromRaw(IReadOnlyList<ReplicationStatus> raw, Boolean bySource, TimeSpan staleThreshold) #ReplicationForestStatsComputes forest-wide replication health statistics from pre-fetched raw replication rows.
Parameters
- raw System.Collections.Generic.IReadOnlyList{ADPlayground.Replication.ReplicationStatus}
- bySource System.Boolean
- staleThreshold System.TimeSpan
public static IReadOnlyList<ReplicationForestSummary> GetForestSummary(Boolean bySource = false) #IReadOnlyList<ReplicationForestSummary>Builds a forest view summarizing replication by destination server (or by source when requested).
Parameters
- bySource System.Boolean = false
- When true, groups by source server instead of destination.
public static IReadOnlyList<ReplicationForestSummary> GetForestSummary(ReplicationQueryOptions options, Boolean bySource = false) #IReadOnlyList<ReplicationForestSummary>Builds a forest view summarizing replication using query options (scope, credentials, data source).
Parameters
- options ADPlayground.Replication.ReplicationQueryOptions
- Query options controlling scope and data source.
- bySource System.Boolean = false
- When true, groups by source server instead of destination.
public static IReadOnlyList<ReplicationForestSummary> GetForestSummary(String domainName, Boolean bySource = false) #IReadOnlyList<ReplicationForestSummary>Builds a forest view summarizing replication for a given domain.
Parameters
- domainName System.String
- DNS domain name to filter.
- bySource System.Boolean = false
- When true, groups by source server instead of destination.
public static IReadOnlyList<ReplicationForestSummary> GetForestSummaryFromRaw(IReadOnlyList<ReplicationStatus> raw, Boolean bySource = false) #IReadOnlyList<ReplicationForestSummary>Computes a forest-wide replication summary (repadmin /replsummary-like) from pre-fetched raw replication rows.
Parameters
- raw System.Collections.Generic.IReadOnlyList{ADPlayground.Replication.ReplicationStatus}
- bySource System.Boolean = false
public static IReadOnlyList<ReplicationStatus> GetForServer(String serverName, Boolean includeEventLogs = false, Boolean outbound = false) #IReadOnlyList<ReplicationStatus>Returns replication status entries for a specific domain controller (inbound neighbors).
Parameters
- serverName System.String
- includeEventLogs System.Boolean = false
- outbound System.Boolean = false
public static IReadOnlyList<ReplicationStatus> GetForServer(String serverName, ReplicationQueryOptions options) #IReadOnlyList<ReplicationStatus>Returns replication status entries for a specific domain controller using advanced options (credentials, direction, filtering).
Parameters
- serverName System.String
- Target domain controller name (DNS or NetBIOS).
- options ADPlayground.Replication.ReplicationQueryOptions
- Replication query options controlling scope, credentials, and direction.
Returns
Replication status rows for the specified server.
public static ReplicationShowReplReport GetShowReplReport(ReplicationQueryOptions options) #ReplicationShowReplReportBuilds a showrepl-style report (per neighbor / naming context rows) using query options.
Parameters
- options ADPlayground.Replication.ReplicationQueryOptions
- Query options controlling scope and data source.
public static IReadOnlyList<ReplicationShowReplRow> GetShowReplRows(ReplicationQueryOptions options) #IReadOnlyList<ReplicationShowReplRow>Returns showrepl-style rows using query options.
Parameters
- options ADPlayground.Replication.ReplicationQueryOptions
- Query options controlling scope and data source.
public static IReadOnlyList<ReplicationShowReplRow> GetShowReplRowsFromRaw(IReadOnlyList<ReplicationStatus> raw) #IReadOnlyList<ReplicationShowReplRow>Converts raw replication rows into showrepl-style rows.
Parameters
- raw System.Collections.Generic.IReadOnlyList{ADPlayground.Replication.ReplicationStatus}
- Raw replication status rows.
public static IReadOnlyList<ReplicationSummary> GetSummary() #IReadOnlyList<ReplicationSummary>Computes a per-DC summary (neighbors, failed, insecure, last success) for the current forest using a 1-day stale threshold.
public static IReadOnlyList<ReplicationSummary> GetSummary(ReplicationQueryOptions options) #IReadOnlyList<ReplicationSummary>Computes a per-DC summary using custom query options (domain scope, outbound, event logs).
Parameters
- options ADPlayground.Replication.ReplicationQueryOptions
- Query options controlling scope and direction.
public static IReadOnlyList<ReplicationSummary> GetSummary(Boolean outbound) #IReadOnlyList<ReplicationSummary>Computes a per-DC summary for the current forest; optionally shows outbound replicas.
Parameters
- outbound System.Boolean
- When true, summarizes outbound neighbors instead of inbound.
public static IReadOnlyList<ReplicationSummary> GetSummary(String domainName) #IReadOnlyList<ReplicationSummary>Computes a per-DC summary for a given domain using a 1-day stale threshold.
Parameters
- domainName System.String
- DNS domain name.
public static IReadOnlyList<ReplicationSummary> GetSummary(ReplicationQueryOptions options, TimeSpan staleThreshold) #IReadOnlyList<ReplicationSummary>Computes a per-DC summary for a given domain; optionally shows outbound replicas.
Parameters
- domainName System.String
- DNS domain name.
- outbound System.Boolean
- When true, summarizes outbound neighbors instead of inbound.
public static IReadOnlyList<ReplicationSummary> GetSummary(String domainName, TimeSpan staleThreshold) #IReadOnlyList<ReplicationSummary>Computes a per-DC summary for a given domain with a custom stale threshold.
Parameters
- domainName System.String
- DNS domain name.
- staleThreshold System.TimeSpan
- Duration after which a neighbor is considered stale.
public static IReadOnlyList<ReplicationSummary> GetSummary(String domainName, TimeSpan staleThreshold, Boolean outbound) #IReadOnlyList<ReplicationSummary>Computes a per-DC summary for a given domain with a custom stale threshold; optionally summarizes outbound replicas.
Parameters
- domainName System.String
- DNS domain name.
- staleThreshold System.TimeSpan
- Duration after which a neighbor is considered stale.
- outbound System.Boolean
- When true, summarizes outbound neighbors instead of inbound.
public static IReadOnlyList<ReplicationSummary> GetSummary(TimeSpan staleThreshold) #IReadOnlyList<ReplicationSummary>Computes a per-DC summary across the forest with a custom stale threshold.
Parameters
- staleThreshold System.TimeSpan
- Duration after which a neighbor is considered stale.
public static IReadOnlyList<ReplicationSummary> GetSummary(TimeSpan staleThreshold, Boolean outbound) #IReadOnlyList<ReplicationSummary>Computes a per-DC summary across the forest with a custom stale threshold; optionally summarizes outbound replicas.
Parameters
- staleThreshold System.TimeSpan
- Duration after which a neighbor is considered stale.
- outbound System.Boolean
- When true, summarizes outbound neighbors instead of inbound.
GetSummary(ADPlayground.Replication.ReplicationQueryOptions options, System.TimeSpan staleThreshold) #Computes a per-DC summary using query options and custom stale threshold.
Parameters
- options ADPlayground.Replication.ReplicationQueryOptions
- staleThreshold System.TimeSpan
public static IReadOnlyList<ReplicationSummary> GetSummaryFromRaw(IReadOnlyList<ReplicationStatus> raw, TimeSpan staleThreshold) #IReadOnlyList<ReplicationSummary>Computes a per-DC summary from already collected raw status rows. Useful for callers that need to avoid double enumeration (e.g., monitoring).
Parameters
- raw System.Collections.Generic.IReadOnlyList{ADPlayground.Replication.ReplicationStatus}
- Raw replication status rows.
- staleThreshold System.TimeSpan
- Stale threshold for summaries.
public static ReplicationTopologyReport GetTopologyReport(ReplicationQueryOptions options, TimeSpan staleThreshold) #ReplicationTopologyReportBuilds a typed replication topology report for the provided query options.
Parameters
- options ADPlayground.Replication.ReplicationQueryOptions
- Query options controlling scope and direction.
- staleThreshold System.TimeSpan
- Threshold used to classify stale edges.
public static ReplicationTopologyReport GetTopologyReportFromRaw(IReadOnlyList<ReplicationStatus> raw, TimeSpan staleThreshold) #ReplicationTopologyReportBuilds a typed replication topology report from raw status rows.
Parameters
- raw System.Collections.Generic.IReadOnlyList{ADPlayground.Replication.ReplicationStatus}
- Raw replication status rows.
- staleThreshold System.TimeSpan
- Threshold used to classify stale edges.
Inherited Methods
Properties
public static IReplicationEventLogAnalyzer EventLogAnalyzer { get; set; } #Optional event-log analyzer used to compute ConsecutiveFailures when requested. Defaults to a no-op provider to avoid any event log dependencies unless opted-in. TODO(EventLogs): Wire this to the repository's event log library implementation.