Link to home
Start Free TrialLog in
Avatar of Simon336697
Simon336697Flag for Australia

asked on

Finding what Active Directory sites do not have domain controllers

Dear guys,
I hope you are all well.

We often have the issue whereby for whatever reason, we may go into AD sites and subnets, and find that a domain controller does not exist for a site.

What I woukd like to do is the following:
Build a query that:

1) Returns a list of all AD sites
2) For each site, query the presence of an NTDS settings object
3) Depending on the outcome of step 2), write the site name to one of 2 possible files:

Site-dc-yes.txt

Or

Site-dc-no.txt

So, for example, a site that has no NTDS settings object means it has no domain controller, so write its site name to the file: Site-dc-no.txt

Any help greatly appreciated.
ASKER CERTIFIED SOLUTION
Avatar of Jaihunt
Jaihunt
Flag of India 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
SOLUTION
Avatar of SubSun
SubSun
Flag of India 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
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
Avatar of Simon336697

ASKER

Thanks so much