Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  List  All  the  Sites  in  Active  Directory  as  well  as  All  the  Servers  in  Those  Sites  

 Content of List All the Sites in Active Directory as well as All the Servers in Those Sites.vbs
MD5 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 ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a