Share via


DaysBeforeGarbageCollection Property

DaysBeforeGarbageCollection Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The DaysBeforeGarbageCollection property specifies the number of days deleted mail is retained before it is permanently deleted.

Applies To

IMailBoxStore Interface

Type Library

Microsoft CDO for Exchange Management Library

DLL Implemented In

CDOEXM.DLL

Syntax

[Visual Basic]Property DaysBeforeGarbageCollection As Long

[C++]HRESULT get_DaysBeforeGarbageCollection(longpVal);
HRESULT put_DaysBeforeGarbageCollection(long Val);

Parameters

  • pVal
    Returns the value of the DaysBeforeGarbageCollection property as a reference to a long.
  • Val
    Sets the value of the DaysBeforeGarbageCollection property to the value of the long.

Remarks

The default value for this property is 0.

Example

The following example illustrates the DaysBeforeGarbageCollection property using Active Directory Service Interfaces (ADSI).

[Visual Basic]

Sub Set_Cleanup(DCServer As String, _ DomainName As String, _ recipname As String)

'DCServer is something like "DCServer6" 'DomainName is something like "DC=MYDOMAIN3,DC=example,DC=com" 'recipname is something like "jamessmith"

Dim objUser As IADsUser Dim objMailbox As CDOEXM.IMailboxStore

'assumes users are in users container and not an OU Set objUser = GetObject("LDAP://" + DCServer + _ "/CN=" + recipname + _ ",CN=users," + DomainName)

Set objMailbox = objUser 'check if user has been mailbox enabled If objMailbox.HomeMDB = "" Then MsgBox "No mailbox found." Else objMailbox.GarbageCollectOnlyAfterBackup = True objMailbox.DaysBeforeGarbageCollection = 7 'commit the changes objUser.SetInfo End If

End Sub

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.