Get List of all DC’s in your Domain
Posted by: Colin Smith
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.



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