SPSite.Delete Method (Boolean, Boolean)
Deletes the site collection from the server, optionally removes the site collection users from Active Directory Domain Services (ADDS), and optionally uses a timer job to delete the site collection gradually.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Available in SharePoint Online
Syntax
'Declaration
<SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.PerSpec)> _
Public Sub Delete ( _
deleteADAccounts As Boolean, _
gradualDelete As Boolean _
)
'Usage
Dim instance As SPSite
Dim deleteADAccounts As Boolean
Dim gradualDelete As Boolean
instance.Delete(deleteADAccounts, gradualDelete)
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.PerSpec)]
public void Delete(
bool deleteADAccounts,
bool gradualDelete
)
Parameters
deleteADAccounts
Type: System.Booleantrue to remove the site collection users from ADDS; otherwise, false.
gradualDelete
Type: System.Booleantrue to delete the contents of the site collection gradually using the Gradual Delete timer job; false to delete the contents of the site collection immediately.