Get-ADTargetServer
DC Resolution Helper
Resolves the correct writable domain controller for any identity across the full
AD forest. Queries the Global Catalog (auto-discovered or explicit) and extracts
the domain DNS name from the returned DistinguishedName. Discovers a writable DC
with explicit RODC exclusion via -Writable. Accepts SamAccountName,
UPN, email, DistinguishedName, or ObjectGUID. Supports -PreferredSite
with automatic cross-site fallback. Reusable helper consumed by
Get-MyUser and all module functions requiring domain-aware DC resolution.