Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Create an Active Directory SiteContent of Create an Active Directory Site.vbsMD5 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 :: |