Get List of all DC’s in your Domain - The Multifunctioning DBA

The Multifunctioning DBA

Jul 22 2009   9:59PM GMT

Get List of all DC’s in your Domain



Posted by: Colin Smith
Powershell, Domain Administration, Windows Administration

I am working on converting a vbscript that I wrote a couple of years ago into a powershell script. This script requires that I query all of the Domain Controllers in my domain to get the most up to date data that is possible. I used the Quest AD Commanlets and they made it easy. I have discussed these in the past and if you have not gotten them yet then go get them. They are at the following link:

 http://www.quest.com/powershell/activero…

to get a listing of your DC’s just do the following.

$dcs = Get-QADComputer -ComputerRole DomainController

now you have a listing of them in the $dcs variable and you can scan them all.

Comment on this Post


You must be logged-in to post a comment. Log-in/Register