Avatar of Lofty Worm
Lofty Worm
Flag 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.
Active DirectoryDNSWindows Server 2008

Avatar of undefined
Last Comment
Aaron Tomosky

8/22/2022 - Mon
SOLUTION
David Johnson, CD

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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
Aaron Tomosky

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Lofty Worm

ASKER
very VERY nice :)
Saved me BUNCHS of work :)

Thank you both so much, wish I could give out more then 500 points!
Lofty Worm

ASKER
Very nice, :)
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Lofty Worm

ASKER
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?
Aaron Tomosky

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