TestimoX

API Reference

Class

SysvolEngine

Namespace ADPlayground.Sysvol
Assembly ADPlayground
Modifiers sealed

Centralized helper for building SYSVOL UNC paths and reading files via a preferred (healthy) DC. Keeps callers consistent and makes it trivial to pivot to DFS when needed.

Inheritance

  • Object
  • SysvolEngine

Constructors

public SysvolEngine(SysvolEngineOptions options = null) #

Creates a new instance of SysvolEngine.

Parameters

options ADPlayground.Sysvol.SysvolEngineOptions = null optionalposition: 0
Optional engine options. Defaults are used when omitted.

Methods

public IEnumerable<String> CandidatesForRelativePath(String domainName, String relativePath) #
Returns: IEnumerable<String>

Returns candidate UNC paths for a relative SYSVOL path, prioritizing healthy DCs.

Parameters

domainName System.String requiredposition: 0
relativePath System.String requiredposition: 1
public String GpoRoot(String domainName, Guid gpoId) #
Returns: String

Computes the UNC path to a GPO folder identified by GUID.

Parameters

domainName System.String requiredposition: 0
gpoId System.Guid requiredposition: 1
public Boolean IsUncServerReachable(String uncPath) #
Returns: Boolean

Quickly checks whether the UNC server portion is reachable over SMB (TCP 445), honoring the negative cache. Use this before expensive File/Directory.Exists on UNC.

Parameters

uncPath System.String requiredposition: 0
UNC path (\\server\share\...).

Returns

True if the server appears reachable; false for unreachable/unknown.

public String PoliciesRoot(String domainName) #
Returns: String

Computes the UNC path to the Policies root for the specified domain, preferring a healthy DC.

Parameters

domainName System.String requiredposition: 0
public String PoliciesRootOnDc(String domainName, String dcName, Boolean requireReachable = true) #
Returns: String

Returns the Policies root UNC for a specific DC when reachable.

Parameters

domainName System.String requiredposition: 0
dcName System.String requiredposition: 1
requireReachable System.Boolean = true optionalposition: 2
public String RewriteGpoSysvolPath(String domainName, String gpcFileSysPath, Guid gpoId) #
Returns: String

Rewrites a gPCFileSysPath (e.g., \\dc\SYSVOL\domain\Policies\{GUID}) to a healthy DC if the original server is unreachable.

Parameters

domainName System.String requiredposition: 0
gpcFileSysPath System.String requiredposition: 1
gpoId System.Guid requiredposition: 2
public String RewriteSysvolUnc(String domainName, String uncPath) #
Returns: String

Rewrites any SYSVOL UNC to prefer a healthy DC when appropriate. If the UNC targets a specific DC and NoFallbackOnExplicitDc is true, the path is returned unchanged even if the DC is unreachable.

Parameters

domainName System.String requiredposition: 0
DNS domain name (used to identify DFS vs DC UNC).
uncPath System.String requiredposition: 1
Original UNC path (e.g., \\DC01\SYSVOL\domain\Policies\...).

Returns

Rewritten UNC or the original when rewrite is not applicable; null when no viable candidate found.

public String TryPickExisting(String domainName, String relativePath) #
Returns: String

Tries to resolve a relative SYSVOL path to an existing UNC path by probing candidates.

Parameters

domainName System.String requiredposition: 0
relativePath System.String requiredposition: 1

Properties

public static SysvolEngine Current { get; } #

Singleton instance with default options.

public SysvolEngineOptions Options { get; } #

Runtime options controlling path resolution behavior.