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:  Create  an  Active  Directory  Site  

 Content of Create an Active Directory Site.vbs
MD5 Hash: F331E5B82DF0D4539B6F31A295B6CB9B
' Description: Creates an Active Directory site and sets the site link for the new site.


strSiteRDN = "cn=Ga-Atl-Sales"
strSiteLinkRDN = "cn=DEFAULTIPSITELINK"
strSiteLinkType = "IP"

Const ADS_PROPERTY_APPEND = 3

Set objRootDSE = GetObject("LDAP://RootDSE")
strConfigurationNC = objRootDSE.Get("configurationNamingContext")
strSitesContainer = "LDAP://cn=Sites," & strConfigurationNC

Set objSitesContainer = GetObject(strSitesContainer)

Set objSite = objSitesContainer.Create("site", strSiteRDN)
objSite.SetInfo

Set objLicensingSiteSettings = objSite.Create("licensingSiteSettings", _
"cn=Licensing Site Settings")
objLicensingSiteSettings.SetInfo

Set objNtdsSiteSettings = objSite.Create("nTDSSiteSettings", _
"cn=NTDS Site Settings")
objNtdsSiteSettings.SetInfo

Set objServersContainer = objSite.Create("serversContainer", "cn=Servers")
objServersContainer.SetInfo

strSiteLinkPath = "LDAP://" & strSiteLinkRDN & ",cn=" & strSiteLinkType & _
",cn=Inter-Site Transports,cn=Sites," & strConfigurationNC

Set objSiteLink = GetObject(strSiteLinkPath)
objSiteLink.PutEx ADS_PROPERTY_APPEND, "siteList", _
Array(objSite.Get("distinguishedName"))
objSiteLink.SetInfo

   © 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