Skip to content

Instantly share code, notes, and snippets.

@MWRobertson
Last active May 25, 2022 19:44
Show Gist options
  • Save MWRobertson/5a2bd201c336f7ac4615e216fcde80ba to your computer and use it in GitHub Desktop.
Save MWRobertson/5a2bd201c336f7ac4615e216fcde80ba to your computer and use it in GitHub Desktop.
function Get-SiteCodeCoverage {
[CmdletBinding()]
param(
[Parameter(Mandatory=$TRUE)][ValidateNotNullOrEmpty()][String]$SiteCode,
[Parameter(Mandatory=$TRUE)][ValidateNotNullOrEmpty()][String]$ZoneName = $env:USERDNSDOMAIN,
[Parameter(Mandatory=$TRUE)][ValidateNotNullOrEmpty()][String]$DNSServer
)
Get-DnsServerResourceRecord -ZoneName $ZoneName -ComputerName $DNSServer -RRType Srv |`
? {$_.HostName -eq "_kerberos.tcp.$SiteCode._sites.dc._msdcs" -or`
$_.HostName -eq "_ldap._tcp.$SiteCode._sites.dc._msdcs"} |`
Select HostName, RecordType -ExpandProperty RecordData
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment