PowerShell Logo Small

Get-ADDomainController



This is the built-in help made by Microsoft for the command 'Get-ADDomainController', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Gets one or more Active Directory domain controllers based on discoverable services criteria, search parameters or by providing a domain controller identifier, such as the NetBIOS name.

SYNTAX


Get-ADDomainController [[-Identity] <ADDomainController>] [-AuthType <ADAuthType>] [-Credential <PSCredential>] [-Server <String>]
[<CommonParameters>]
Get-ADDomainController [-AuthType <ADAuthType>] [-AvoidSelf [<SwitchParameter>]] [-DomainName <String>] [-ForceDiscover [<SwitchParameter>]]
[-MinimumDirectoryServiceVersion <ADMinimumDirectoryServiceVersion>] [-NextClosestSite [<SwitchParameter>]] [-Service
<ADDiscoverableService[]>] [-SiteName <String>] [-Writable [<SwitchParameter>]] -Discover [<SwitchParameter>] [<CommonParameters>]
Get-ADDomainController [-AuthType <ADAuthType>] [-Credential <PSCredential>] [-Server <String>] -Filter <String> [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Get-ADDomainController cmdlet gets the domain controllers specified by the parameters. You can get domain controllers by setting the
Identity, Filter or Discover parameters.


The Identity parameter specifies the domain controller to get. You can identify a domain controller by its GUID, IPV4Address, global
IPV6Address, or DNS host name. You can also identify a domain controller by the name of the server object that represents the domain
controller, the Distinguished Name (DN) of the NTDS settings object or the server object, the GUID of the NTDS settings object or the server
object under the configuration partition, or the DN of the computer object that represents the domain controller. You can also set the
Identity parameter to a domain controller object variable, such as $<localDomainControllerObject>, or pass a domain controller object through
the pipeline to the Identity parameter.


To search for and retrieve more than one domain controller, use the Filter parameter. The Filter parameter uses the PowerShell Expression
Language to write query strings for Active Directory. PowerShell Expression Language syntax provides rich type conversion support for value
types received by the Filter parameter. For more information about the Filter parameter syntax, see about_ActiveDirectory_Filter. You cannot
use an LDAP query string with this cmdlet.


To get a domain controller by using the discovery mechanism of DCLocator, use the Discover parameter. You can provide search criteria by
setting parameters such as Service, SiteName, DomainName, NextClosestSite, AvoidSelf, and ForceDiscover.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=219306
Add-ADDomainControllerPasswordReplicationPolicy
Get-ADDomainControllerPasswordReplicationPolicy
Remove-ADDomainControllerPasswordReplicationPolicy

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

C:\PS>Get-ADDomainController -Discover -Site "Default-First-Site-Name"



Description

-----------

Get one available DC in a given site using Discovery.




-------------------------- EXAMPLE 2 --------------------------

C:\PS>Get-ADDomainController -Discover -Site "Default-First-Site-Name" -ForceDiscover



Description

-----------

Force discover/find one available DC in a given site.




-------------------------- EXAMPLE 3 --------------------------

C:\PS>Get-ADDomainController -Discover -Service "GlobalCatalog"



Description

-----------

Get a global catalog in the current forest using Discovery.




-------------------------- EXAMPLE 4 --------------------------

C:\PS>Get-ADDomainController -Discover -Service 2



Description

-----------

Get a global catalog in the current forest using Discovery.




-------------------------- EXAMPLE 5 --------------------------

C:\PS>Get-ADDomainController -Discover



Description

-----------

Get one available DC in the current domain using Discovery.




-------------------------- EXAMPLE 6 --------------------------

C:\PS>Get-ADDomainController -Discover -Domain "fabrikam.com"



Description

-----------

Get one available DC in a given domain using Discovery.




-------------------------- EXAMPLE 7 --------------------------

C:\PS>Get-ADDomainController -Discover -Domain "corp.contoso.com" -Service "PrimaryDC","TimeService"



Description

-----------

Get the PDC using Discovery and make sure that is advertising as a time server.




-------------------------- EXAMPLE 8 --------------------------

C:\PS>Get-ADDomainController -Identity "PDC-01"



Description

-----------

Get a domain controller using its NetBIOS name.




-------------------------- EXAMPLE 9 --------------------------

C:\PS>Get-ADDomainController "PDC-01"



Description

-----------

Get a domain controller using its NetBIOS name.




-------------------------- EXAMPLE 10 --------------------------

C:\PS>Get-ADDomainController -Identity "TK5-CORP-DC-10.fabrikam.com" -Server "fabrikam.com" -Credential "corp\administrator"



Description

-----------

Get a domain controller using its DNS host name, in a given domain (specified in Server parameter) and specifying administrator credentials.




-------------------------- EXAMPLE 11 --------------------------

C:\PS>Get-ADDomainController -Identity "168.54.62.57"



Description

-----------

Get a domain controller using its IP address.




-------------------------- EXAMPLE 12 --------------------------

C:\PS>Get-ADDomainController -Filter { isGlobalCatalog -eq $true -and Site -eq "Default-First-Site-Name" }



Description

-----------

Get all global catalogs in a given site.




-------------------------- EXAMPLE 13 --------------------------

C:\PS>Get-ADDomainController -Server "research.fabrikam.com" -Filter { isGlobalCatalog -eq $true -and isReadOnly -eq $true }



Description

-----------

Get all ROGCs in the child domain to which the client is connected.




-------------------------- EXAMPLE 14 --------------------------

C:\PS>Get-ADDomainController



Description

-----------

Gets the domain controller in the user's current session. This is the domain controller used as a default Server in the context of an AD
Provider. Using this cmdlet in this way will let you know which Server is being used by default.




-------------------------- EXAMPLE 15 --------------------------

C:\PS>$allDCs = (Get-ADForest).Domains | %{ Get-ADDomainController –Filter * -Server $_ }



Description

-----------

Gets a list of all of the domain controllers for all the domains within a forest.