List Sites in Domain...

  • 69 Views
  • Last Post 02 March 2017
manasrrp6 posted this 01 March 2017

We have a very big domain with single forest. Every time some small & medium size sites are added to our domain time to time by our site engineer. 
How to list number of multiple sites in my Domain using any tools or command line?
--
With Warm Regards,
Manas Dash.
AD & Exchange Admin
+91 9437615424
+91 7400342191
Skype : manasrrp6
Plant a Tree & Save the Earth.

Order By: Standard | Newest | Votes
Milo posted this 01 March 2017

Hi Manas,




AD Sites are held at the forest level, these are used by all domains in the forest, and this information is held in the AD configuration partition. One way to get this info is to use the AD Powershell cmdlets to list out all the AD sites in a forest by running:

(Get-ADForest).Sites




If you want to work out the DCs in each site you could run the following commands in each domain of a forest:

$oDCcol = (Get-ADDomainController -Filter *)

foreach ($oDC in $oDCcol) { write-Host $oDC.name $oDC.site }




Thanks




Milo










show

MATTNY posted this 01 March 2017

If you're running Windows 2012R2 or later OS, you can use PowerShell: get-adreplicationsite -filter *| ft name    

show

a4haq posted this 02 March 2017

Hi,
You may also use dsquery command line tool to list all AD sites i.e. "dsquery site -name * -limit 0"
Regards,Aziz

show

manasrrp6 posted this 02 March 2017

Hi Aziz,
What will be the output if I change the value to as like for example  "-limit 1 or 2 or 3 ".


show

a4haq posted this 02 March 2017

Hi,
The "-limit 0" means to print all sites on screen if you have more than 100 sites in your domain. By default dsquery will query only first 100 sites or any other objects that you want to query wihtout "-limit 0". If total sites are less than 100 then no need to use "-limit 0" switch.
For more information you may go through help manual of dsquery by typing "dsquery /?" at command prompt.
Regards,Aziz


show

Close