Identifying what domain controllers are not global catalogs

Dear everyone,

I hope you are all well and can assist.

I would like to build a query at does the following:

1) Gets a list of all domain controllers
2) For each domain controller, determine if it is a global catalog or not
3) Write to a file the names of the domain controllers that are not global catalogs

Any help greatly appreciated.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike KlineCommented:
adfind is a great freeware tool by Joe Richards

He has shortcuts that can really make this easy

adfind -sc gclist  
This dumps all GCs

adfind -sc !gclist
This dumps all non-GCs

If you have Visio you can also use the AD topology diagrammer and it will draw your DCs



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Simon336697Author Commented:
Hi mike, you are a champion.
Simon336697Author Commented:
Mike, with the returned domain controllers that are not GCs, is there a way to loop through that list and add the GC role to them?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Mike KlineCommented:
You would have to pipe it into admod.  I'd have to test it out.  Don't want to give you code that doesn't work.

How many do you have?


use powershell:
Get-ADDomainController -Discover -Service "GlobalCatalog" > output.txt

to get the GC DC's then run script again without -service switch to get All the DC's can save it as getDC.ps1and then call that with your query
Simon336697Author Commented:
Thanks so much
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.