Recipe 16.13 Changing the Garbage Collection Interval

16.13.1 Problem

You want to change the default garbage collection interval.

16.13.2 Solution

16.13.2.1 Using a graphical user interface
  1. Open ADSI Edit.

  2. In the left pane, expand cn=Configuration cn=Services cn=Windows NT.

  3. Right-click on cn=Directory Service and select Properties.

  4. Edit the garbageColPeriod attribute and set it to the interval in hours that the garbage collection process should run (the default is 12 hours).

  5. Click OK.

16.13.2.2 Using a command-line interface

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

dn: cn=Directory Service,cn=Windows NT,cn=Services,cn=Configuration,<ForestRootDN> changetype: modify replace: garbageCollPeriod garbageCollPeriod: <IntervalInHours> -

then run the following command:

> ldifde -v -i -f change_garbage_period.ldf
16.13.2.3 Using VBScript
' This code changes the default garbage collection interval ' ------ SCRIPT CONFIGURATION ------ intGarbageColl = <IntervalInHours> ' ------ END CONFIGURATION --------- set objRootDSE = GetObject("LDAP://RootDSE") set objDSCont = GetObject("LDAP://cn=Directory Service,cn=Windows NT," & _              "cn=Services," & objRootDSE.Get("configurationNamingContext") ) objDSCont.Put "garbageCollPeriod", intGarbageColl objDSCont.SetInfo WScript.Echo "Successfully set the garbage collection interval to " & _              intGarbageColl

16.13.3 Discussion

When an object is deleted from the Configuration naming context, a Domain naming context, or an application partition, the original object is removed from Active Directory, and a tombstone object is created that contains a small subset of the object's original attributes. This tombstone object remains in Active Directory for the duration of the tombstone lifetime (default is 60 days) before it gets completely removed. See Recipe 16.18 for more information on the tombstone lifetime.

A garbage collection process runs on each domain controller that automatically removes expired tombstone objects. This process runs every 12 hours by default, but you can change it to run more or less frequently by setting the garbageCollPeriod attribute on the cn=DirectoryService,cn=WindowsNT,cn=Services,cn=Configuration, <RootDomainDN> object to the frequency in hours.

16.13.4 See Also

Recipe 16.18 for modifying the tombstone lifetime, Recipe 16.14 for logging the number of tombstones that get garbage collected, and MS KB 198793 (The Active Directory Database Garbage Collection Process)



Active Directory Cookbook
Active Directory Cookbook, 3rd Edition
ISBN: 0596521103
EAN: 2147483647
Year: 2006
Pages: 456

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net