03 April 2013

Find all domain controllers in domain


Using powershell one can find all domain controllers in domain using:

1. a LDAP filter:

Get-ADComputer -LDAPFilter "(&(objectCategory=computer)(userAccountControl:1.2.840.113556.1.4.803:=8192))"


2. "Domain controllers" group and retreive his memebers:

Get-ADGroupMember 'Domain Controllers'


3. Get-ADDomainController cmdlet:

Get-ADDomainController -Filter * | Select-Object name

1 comment: