Creating a Site






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

You can also create a site by issuing the following four AdMod commands:

	> admod -b "cn=Licensing Site Settings,cn=<SiteName,
	cn=sites,cn=configuration,<ForestRootDN>" objectclass::licensingSiteSettings -add
	> admod -b "cn=NTDS Site Settings,cn=<SiteName,
	cn=sites,cn=configuration,<ForestRootDN>" objectclass::nTDSSiteSettings -add
	> admod -b "cn=NTDS Site Settings,cn=<SiteName,
	cn=sites,cn=configuration,<ForestRootDN>" objectclass::nTDSSiteSettings -add
	> admod -b cn=Servers,cn=<SiteName>,cn=sites,cn=configuration,<ForestRootDN>"
	objectclass::serversContainer -add

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")
	objLicensing.SetInfo

	' Create the NTDS Site Settings object
	set objNTDS = objSite.Create(" 
nTDSSiteSettings","cn=NTDS Site Settings")
	objNTDS.SetInfo

	' Create the Servers container
	set objServersCont = objSite.Create(" 
serversContainer","cn=Servers")
	objServersCont.SetInfo

	WScript.Echo "Successfully created site " & strSiteName

Discussion

To create a site in Active Directory, you have to create a number of objects. The first is a site object, which is the root of all the other objects. The site object contains the following:


licensingSiteSettings

This object isn't mandatory but is created automatically when creating a site with AD Sites and Services. It is intended to point clients to a license server for the site.


nTDSSiteSettings

This object stores replication-related properties about a site, such as the replication schedule, current ISTG role holder, and whether universal group caching is enabled.


serversContainer

This container is the parent of the server objects that are part of the site. All the domain controllers that are members of the site will be represented in this container.

After these objects are created, you've essentially created an empty site. If you didn't do anything else, the site would not be of much value. To make it usable, you need to assign subnet objects to it (see Recipe 12.11),and add the site to a siteLink object to link the site to other sites (see Recipe 12.14). At that point, you can promote or move domain controllers into the site, and it should be fully functional.

See Also

Recipe 12.11, Recipe 12.14, and MS KB 318480 (How to Create and Configure an Active Directory Site in Windows 2000)



 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows