Gets the domain controller of the current computer's domain, or for a specific domain.
Get-ADDomainController [[-Domain] <String>] [<CommonParameters>]
When working with Active Directory, it's important to have the hostname of the domain controller you need to work with. This function will find the domain controller for the domain of the current computer or the domain controller for a given domain.
The domain whose domain controller to get. If not given, gets the current computer's domain controller.
Returns the domain controller for the current computer's domain.
Approximately equivialent to the hostname given in the LOGONSERVER environment variable.
Get-ADDomainController -Domain MYDOMAIN
Returns the domain controller for the MYDOMAIN domain.