Get-ADDomainController: Getting Domain Controllers Info via PowerShell

You can use the Get-ADDomainController PowerShell cmdlet to get details about the area controllers in Active Directory. This cmdlet is part of and requires RSAT set up (onWindows 10 1809 and newer ).

Get-ADDomainController Cmdlet

When operating Get-ADDomainController with none parameters, the cmdlet shows the details about the present area controller (LogonServer) utilized by this pc to get authenticated (the DC is chosen in keeping with the AD website an IP subnets topology).

Get-ADDomainController - get full DC info via powershell

The cmdlet returned all fields with the details about the area controller out there in Active Directory database.

PcObjectDN : CN=MunDC01,OU=Domain Controllers,DC=corp,DC=woshub,DC=com
DefaultPartition : DC=corp,DC= woshub,DC=com
Domain :
Enabled : True
Forest :
HostName :
InvocationId : 921234a-2a32-4312-9e12-3b32343ab4ad
IPv4Address :
IPv6Address :
IsGlobalCatalog : True
IsReadOnly : False
LdapPort : 389
Name : MunDC01
NTDSSettingsObjectDN : CN=NTDS Settings,CN=MunDC01,CN=Servers,CN=DE,CN=Sites,CN=Configuration,DC=woshub,DC=com
OperatingSystem : Windows Server 2012 R2 Standard
OperatingSystemHotfix :
OperatingSystemServicePack :
OperatingSystemVersion : 6.three (9600)
OperationMasterRoles : 
Partitions : 
ServerObjectDN : CN=MunDC01,CN=Servers,CN=DE,CN=Sites,CN=Configuration,DC=woshub,DC=com
ServerObjectGuid : 8123453-e294-1234-a987-1234535432d6
Site : DE
SslPort : 636

Also, you’ll find the area controller, to which your pc ought to belong via the DCLocator service:

Get-ADDomainController –Discover

You can discover the closest out there DC with the energetic AD Web Services position:

Get-ADDomainController –ForceDiscover -Discover -Service ADWS

You can use the Service parameter to seek out the PDC (or different ) in your area:

Get-ADDomainController -Discover -Service PrimaryDC

If your area controller just isn’t discovered or not responding, you’ll find the area controller on the closest AD website (decided by the burden of intersite hyperlinks):

Get-ADDomainController –Discover –ForceDiscover -NextClosestSite

To show the checklist of all area controllers within the present area, run this command:

Get-ADDomainController -Filter * | ft

list all DCs in AD using powershell

Using this command, you’ll be able to depend the variety of area controllers in AD:

Get-ADDomainController -Filter * | Measure-Object

get domain controller number in ad

You can show a extra handy desk displaying all area controllers, their host names, IP addresses, OS variations and AD website names:

Get-ADDomainController -Filter *| Select Name, ipv4Address, OperatingSystem, website | Sort-Object identify

Get-ADDomainController list all domain controllers with operation system info

If you need to get some details about a DC from one other area, specify the identify of any out there DC in one other area utilizing the –Server parameter (it’s attainable in case of enabling belief relationships between the domains).

Get-ADDomainController -Filter * -server dc01.take a look | Select Name, ipv4Address, IsGlobalCatalog, Site

get DC info from another domain

Using Get-ADDomainController to Find Domain Controllers By Certain Criteria

Let’s contemplate some helpful instructions you should use to get the checklist of area controllers in AD in keeping with sure standards.

To discover a area controller by its IP deal with:

Get-ADDomainController -Identity ""

To discover all DCs which have DC02 of their names:

Get-ADDomainController -Filter | Select Name, ipv4Address, OperatingSystem, website

To discover all out there DCs on the precise website:

Get-ADDomainController -Discover -ForceDiscover -Site "Site-Name"

To show the checklist of DCs on the websites, which names start from Mun*:

Get-ADDomainController -Filter | Select Name, ipv4Address, OperatingSystem, website

To show the checklist of all :

Get-ADDomainController -Filter | Select Name, ipv4Address, OperatingSystem, website

To discover DCs on the “Rome” website with the Global Catalog position enabled:

Get-ADDomainController -Filter | Select Name, ipv4Address, OperatingSystem, website

PowerShell Script to Check Availability of All Domain Controllers

The subsequent PowerShell script permits to examine your area controllers one-by-one and carry out the precise motion for every of them:

$DCs = Get-ADDomainController -Filter *
ForEvery($DC in $DCs)

Here is an instance of a easy PowerShell script that checks the supply of the LDAPS port (TCP 636) on every DC in your area utilizing the . If the LDAPS port just isn’t out there, a warning will seem.

$DCs = Get-ADDomainController -Filter * | Select-Object Hostname,Ipv4address,isGlobalCatalog,Site,Forest,OperatingSystem
ForEvery($DC in $DCs)

powershell script to check the reachability of all Domain Controllers

We have gotten a easy script to watch all DCs availability in your area.

There are additionally totally different eventualities to examine all DCs within the area one-by-one. In earlier articles we’ve got proven how one can use Get-ADDomainController cmdlet to seek out the precise occasion within the logs on all area controllers. For instance, to discover a s, , occasions of , and so forth.

Check Also

How to Restore Deleted EFI System Partition in Windows 10?

In this text we’ll present you ways to manually restore an by chance deleted Windows …

Leave a Reply

Your email address will not be published. Required fields are marked *