Link to home
Start Free TrialLog in
Avatar of Lofty Worm
Lofty WormFlag for United States of America

asked on

DC's in daom by IP and Name

Easy one, I know there must be a fast way to pull all the DC's in my domain (children also pls) and their IP's.  It must be in DNS, and an adsi command or something.
SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lofty Worm

ASKER

TY, you will get some point for certain, but here is another crux.
All the DC's may not be in that OU.  I strongly suspect I will have to pull the information from DNS (not all have NS records though, by design) or Sites and Services.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
very VERY nice :)
Saved me BUNCHS of work :)

Thank you both so much, wish I could give out more then 500 points!
Very nice, :)
ok, this is awesome, but one last question.
On my 2008 DC's in my other domain's, the resolve-dns command is not present.  So
How do I add it?
or
How do I change the domain request from the DC that I have that works?
I don't have an 08 to test on, but you can install newer powershell if you want
http://www.microsoft.com/en-us/download/details.aspx?id=34595

this is the command for powershell 2.0
[Net.DNS]::GetHostEntry("MachineName")

so to integrate it back into the script, but I can't test it so I'm not sure the syntax is correct:
$DCS = Get-ADDomainController -Filter *
foreach ($DC in $DCS){
[Net.DNS]::GetHostEntry("$dc.Name")
}

Open in new window