The knowledge base / All cheat sheets
● Always in your toolkitAbout the project ↗

Active Directory domain controller discovery cheat sheet

Inspect domain controller discovery, DNS service records and site selection from a Windows client.

Windows with the ActiveDirectory and DnsClient PowerShell modules. Directory visibility depends on authorization.

Updated · Active Directory · 6 min read

CommandWhat it does
Get-ADDomainInspect the current domain context
Get-ADDomainController -Filter *List visible domain controllers
Get-ADDomainController -Discover -DomainName 'corp.example'Discover a domain controller
nltest /dsgetsiteIdentify the client AD site
Resolve-DnsName -Name '_ldap._tcp.dc._msdcs.corp.example' -Type SRV -DnsOnlyInspect domain controller DNS records

Walkthrough

Run on the affected domain-connected client and replace corp.example with the actual domain. Discovery and DNS queries contact directory services; no directory settings are changed.

Step 1: Inspect the current domain context

Get-ADDomain

Record the domain DNS root and relevant controller information. The command depends on directory access and current credentials; a failure does not uniquely identify a DNS issue.

Step 2: List visible domain controllers

Get-ADDomainController -Filter *

Compare controller names and site properties with the approved inventory. This lists directory objects visible to the account, not proof that each controller currently accepts client requests.

Step 3: Discover a domain controller

Get-ADDomainController -Discover -DomainName 'corp.example'

Replace the domain and record the selected controller and site returned by discovery. Client location, DNS and directory configuration can affect the result; one successful discovery does not establish replication health.

Step 4: Identify the client AD site

nltest /dsgetsite

Run on the affected client and record the site that Windows reports. Compare it with the expected subnet-to-site mapping; an incorrect or unknown site can affect controller selection.

Step 5: Inspect domain controller DNS records

Resolve-DnsName -Name '_ldap._tcp.dc._msdcs.corp.example' -Type SRV -DnsOnly

Replace the domain and inspect SRV targets and ports returned by the client DNS path. An advertised record alone does not prove that a target is reachable or healthy.

WORKED INCIDENT

Practical case: A branch client chooses an unexpected controller

Fictional teaching scenario; observations are examples, not captured production output.

Situation

A branch workstation discovers a distant controller and experiences slow domain sign-in.

Investigation sequence

1. Inspect the current domain context

Get-ADDomain

Confirm the domain context and directory access from the affected workstation.

2. Discover a domain controller

Get-ADDomainController -Discover -DomainName 'corp.example'

Record the controller and site returned by domain controller discovery.

3. Identify the client AD site

nltest /dsgetsite

Compare the reported client site with the branch network inventory.

4. Inspect domain controller DNS records

Resolve-DnsName -Name '_ldap._tcp.dc._msdcs.corp.example' -Type SRV -DnsOnly

Inspect the domain controller SRV records returned by the client resolver.

Example findings

Illustrative findings: the client reports an unexpected AD site and discovers a controller associated with that site.

Interpret the findings

Site selection is a useful lead in this example; verify subnet mappings, DNS and controller availability before changing directory configuration.

Verify the outcome

After the directory owner corrects the approved configuration, repeat discovery and verify the normal sign-in experience from the branch.

Escalation handoff

Provide the client subnet, reported site, discovered controller and timestamped DNS results to the directory owner.

Primary references

Documented reference; examples above are teaching scenarios. Confirm behavior against your deployed version.