O'Reilly logo

Active Directory Cookbook by Robbie Allen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11.1. Creating a Site

Problem

You want to create a site.

Solution

Using a graphical user interface

  1. Open the Active Directory Sites and Services snap-in.

  2. Right-click on the Sites container and select New Site.

  3. Beside Name, enter the name of the new site.

  4. Under Link Name, select a site link for the site.

  5. Click OK twice.

Using a command-line interface

Create an LDIF file called create_site.ldf with the following contents:

dn: cn=<SiteName>,cn=sites,cn=configuration,<ForestRootDN>
changetype: add
objectclass: site

dn: cn=Licensing Site Settings,cn=<SiteName>,cn=sites,cn=configuration, <ForestRootDN>
changetype: add
objectclass: licensingSiteSettings

dn: cn=NTDS Site Settings,cn=<SiteName>,cn=sites,cn=configuration,<ForestRootDN>
changetype: add
objectclass: nTDSSiteSettings

dn: cn=Servers,cn=<SiteName>,cn=sites,cn=configuration,<ForestRootDN>
changetype: add
objectclass: serversContainer

then run the following command:

> ldifde -v -i -f create_site.ldf

Using VBScript

' This code creates the objects that make up a site.
' ------ SCRIPT CONFIGURATION ------
strSiteName = "<SiteName>" ' e.g. Dallas ' ------ END CONFIGURATION --------- set objRootDSE = GetObject("LDAP://RootDSE") set objSitesCont = GetObject("LDAP://cn=sites," & _ objRootDSE.Get("configurationNamingContext") ) ' Create the site set objSite = objSitesCont.Create("site","cn=" & strSiteName) objSite.SetInfo ' Create the Licensing Site Settings object set objLicensing = objSite.Create("licensingSiteSettings", _ "cn=Licensing Site Settings") ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required