共用方式為


SPSiteAdministration.Delete Method (Boolean, Boolean)

Deletes the site collection with the option of deleting the Active Directory accounts for this site collection.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public Sub Delete ( _
    deleteADAccounts As Boolean, _
    gradualDelete As Boolean _
)
'Usage
Dim instance As SPSiteAdministration
Dim deleteADAccounts As Boolean
Dim gradualDelete As Boolean

instance.Delete(deleteADAccounts, gradualDelete)
public void Delete(
    bool deleteADAccounts,
    bool gradualDelete
)

Parameters

  • deleteADAccounts
    Type: System.Boolean

    true to delete the Active Directory accounts; otherwise, false.

  • gradualDelete
    Type: System.Boolean

    true to mark the site collection as deleted, which immediately prevents any further access to its content. Then, the data in the site collection is deleted gradually over time by a timer job, which reduces its impact on SharePoint Server and SQL Server performance; otherwise, false.

See Also

Reference

SPSiteAdministration Class

SPSiteAdministration Members

Delete Overload

Microsoft.SharePoint.Administration Namespace