Condividi tramite


SPDatabaseSnapshotCollection.EnabledManagement Property

Gets or sets a value that specifies whether the database snapshots for the database are managed by the built-in database snapshot management jobs of SharePoint Foundation.

Namespace:  Microsoft.SharePoint.Administration.Backup
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Property EnabledManagement As Boolean
    Get
    Set
'Usage
Dim instance As SPDatabaseSnapshotCollection
Dim value As Boolean

value = instance.EnabledManagement

instance.EnabledManagement = value
public bool EnabledManagement { get; set; }

Property Value

Type: System.Boolean
true if the database snapshots are managed by the database snapshot management timer jobs that ship with SharePoint Foundation; otherwise, false. The value is a null reference (Nothing in Visual Basic) until either the CreateSnapshot() method is called or it is explicitly set to true or false.

Remarks

When EnabledManagement is false, the SharePoint Foundation built-in timer jobs that create and delete database snapshots of database skip over this database. Consequently, the following properties are ignored by the SharePoint Foundation infrastructure when EnabledManagement is false: CreationInterval, MaximumRetention, and SnapshotLimit. One alternative to having the SharePoint Foundation built-in timer jobs manage database snapshots is to have farm administrators manage them directly in Microsoft SQL Server. Another option is for you to derive your own class from SPJobDefinition and override its [T:Microsoft.SharePoint.Administration.SPJobDefinition.Execute(T:System.Guid)] method to create and delete the database snapshots. For more information about deriving your own SPJobDefinition class, see Programmatic Administration of Database Snapshots. For more information about timer jobs, see SPTimerService and SPServiceJobDefinition.

You must call Update() to save changes to this property.

Examples

In the following example, db is an SPDatabase object.

db.Snapshots.EnabledManagement = true; db.Update();

See Also

Reference

SPDatabaseSnapshotCollection Class

SPDatabaseSnapshotCollection Members

Microsoft.SharePoint.Administration.Backup Namespace