troubleshooting Question

Active Directory Sites and Services Script

Avatar of Indyrb
IndyrbFlag for United States of America asked on
Active DirectoryVB ScriptPowershell
3 Comments1 Solution2218 ViewsLast Modified:
I am looking for a way to complete a inventory of all properties in Active Directory Sites and Services and Export to Excel

Essentially I want the following data

SiteName,  Subnet, Server, Name of Server and IP address - Some sites have more than 1 server, and more than 1 subnet.

Also would like to get Site-Link for appropriate Site, and partner. with replication cost and interval

I have windows 2003 and Windows 2008 domain controllers.
Don't appear to have AD DS Web

I found a dsquery command, but it doesn't appear to work

dsquery site -o rdn -limit 0 > c:\folder\all.sites.txt
for /F %A in (c:\folder\all.sites.txt) do For /F %X in (‘dsquery subnet -site %A -o rdn’) do echo %A,%X >> c:\folder\sites.subnets.csv
for /F %A in (c:\folder\all.sites.txt) do For /F %X in (‘dsquery server -site %A -o rdn’) do echo %A,%X >> c:\folder\sites.Servers.csv
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros