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.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Domain | String | The domain whose domain controller to get. If not given, gets the current computer's domain controller. |
false | false |
Get-ADDomainController
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.