Skip to Content
Active Directory Cookbook
book

Active Directory Cookbook

by Robbie Allen
September 2003
Intermediate to advanced
624 pages
15h 49m
English
O'Reilly Media, Inc.
Content preview from Active Directory Cookbook

16.13. Changing the Garbage Collection Interval

Problem

You want to change the default garbage collection interval.

Solution

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.

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

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

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, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Active Directory Administration Cookbook

Active Directory Administration Cookbook

Sander Berkouwer
Active Directory Cookbook, 3rd Edition

Active Directory Cookbook, 3rd Edition

Laura E. Hunter, Robbie Allen
Active Directory Cookbook, 4th Edition

Active Directory Cookbook, 4th Edition

Brian Svidergol, Robbie Allen

Publisher Resources

ISBN: 0596004648Supplemental ContentCatalog PageErrata