September 2003
Intermediate to advanced
624 pages
15h 49m
English
You want to obtain the list of sites.
Open the Active Directory Sites and Services snap-in.
Click on the Sites container.
The list of sites will be displayed in the right pane.
Double-click on a site to view its properties.
Run the following command to list the sites:
> dsquery site
Run the following command to view the properties for a particular site:
> dsget site "<SiteName>"' This code lists all of the site objects.
set objRootDSE = GetObject("LDAP://RootDSE")
set objSitesCont = GetObject("LDAP://cn=sites," & _
objRootDSE.Get("configurationNamingContext") )
objSitesCont.Filter = Array("site")
for each objSite in objSitesCont
Wscript.Echo " " & objSite.Get("cn")
next
Site objects are stored in the
Sites container (e.g., cn=sites,cn=configuration,dc=rallencorp,dc=com) in the Configuration Naming
Context (CNC). For more information on creating sites,
see Recipe 11.1.