-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate active directory site.vbs
36 lines (25 loc) · 1.27 KB
/
create active directory site.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
' Create an Active Directory 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