Seems like a slow day on the list, so thought I would pass this along in case it might save people some time. I know there are bunch of other ways to enumerate the list of domain controllers in a domain, but I never knew you could enumerate the domain controllers in the forest with repadmin:
repadmin/ viewlist *
Will give you output like this
DSA_LIST[1] = dc1.contoso.com
DSA_LIST[2] = dc2.contoso.com
DSA_LIST[3] = dc3.contoso.com
DSA_LIST[4] = dc4.contoso.com
And you can clean it up a little like this:
for /f "tokens=2 delims==" %i in ('repadmin /viewlist *') do @echo %i
Also found that you can use it for an LDAP query:
repadmin /viewlist dc1.contos.com ncobj:domain: /subtree
/filter:"(&(objectclass=user)(samaccountname=jdo*))"
Amazing what you lean when you actually read the help file:
http://technet.microsoft.com/en-us/library/cc811563(v=ws.10).aspx
Christopher Bodnar
Enterprise Architect I, Corporate Office of Technology:Enterprise
Architecture and Engineering Services
Tel 610-807-6459
3900 Burgess Place, Bethlehem, PA 18017
[email protected]
The Guardian Life Insurance Company of America
www.guardianlife.com
-----------------------------------------
This message, and any attachments to it, may contain information
that is privileged, confidential, and exempt from disclosure under
applicable law. If the reader of this message is not the intended
recipient, you are notified that any use, dissemination,
distribution, copying, or communication of this message is strictly
prohibited. If you have received this message in error, please
notify the sender immediately by return e-mail and delete the
message and any attachments. Thank you.
<<image/jpeg>>

