A. The following script, which you can download here , outputs a list of AD sites:
Set objRootDSE = GetObject("LDAP://RootDSE") strConfigurationNC = objRootDSE.Get("configurationNamingContext") strSitesContainer = "LDAP://cn=Sites," & strConfigurationNC Set objSitesContainer = GetObject(strSitesContainer) objSitesContainer.Filter = Array("site") For Each objSite In objSitesContainer WScript.Echo "Site: " & Mid(objSite.Name,4) NextHere's a sample execution of the above code:
D:\Temp>cscript listsites.vbs Site: Dallas Site: London Site: NewYork
0 comments
Hide comments