« Hear ye, hear ye. | Main | Battlestar Galactica, Season 4 »
Monday
28Apr

Enumerate all DCs in the local domain - Powershell

$dom = [System.DirectoryServices.ActiveDirectory.Domain]::getCurrentDomain()

$dom.FindAllDomainControllers()

Okay, I'll admit it, that's actually kinda not-clunky if you overlook having to address the full S.DS namespace.

(Get that Kool-aid away from me, Brandon. I've already drunk the Federation bug-juice this month, I can't handle any more change right now.  :-))


Reader Comments (4)

How bout this

$dcs = ([System.DirectoryServices.ActiveDirectory.Domain]::getCurrentDomain()).FindAllDomainControllers()
btw... This GREAT koolaid :)
What's wrong with

netdom query dc
April 29, 2008 | Unregistered Commenterme
Nothing wrong with the netdom syntax at all (particularly since it's shorter), I'm just having more fun than I expected making the S.DS stuff work. :-)
April 30, 2008 | Registered CommenterLaura E. Hunter

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.