Loading |
VBScript |
JavaScript |
Powershell |
Search Options: List All the Sites in Active Directory as well as All the Servers in Those SitesContent of List All the Sites in Active Directory as well as All the Servers in Those Sites.vbsMD5 Hash: 2EE475A65E42EB3866D3A55DD273A4EF |
||
On Error Resume Next
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 objSite.CN strSiteName = objSite.Name strServerPath = "LDAP://cn=Servers," & strSiteName & ",cn=Sites," & _ strConfigurationNC Set colServers = GetObject(strServerPath) For Each objServer In colServers WScript.Echo vbTab & objServer.CN Next Wscript.Echo Next | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |