Contents
How to delete site collection on prem using CSOM?
You are correct: We are trying to delete Site Collection on Prem using CSOM. We use the PnP Partner Pack with SP2016 and try to avoid any server side code. To cover the full life cycle of a project room, it shall be deleted in the end. For various reasons we can’t use the site policy feature to achieve this.
Is there a way to delete site collections?
It is said that the method to delete site collections is supported. And in fact we can call the method on prem but we always get an access denied even though the account is site collection admin in the tenant site, the site that shall be deleted. We even tried farm-admin and App-Only-Auth, but nothing worked for us.
How to get all site collections with CSOM-SharePoint?
I’ve been working on an provider-hosted app that shows all sitecollections in the current Web application (Tenant). I I’ve done it on Online using SPOSitePropertiesEnumerable but I’ve been struggling doing it on-prem.
How to get the deleted collections from SharePoint?
For permissions and the most current information about Windows PowerShell for SharePoint Online, see the online documentation at Intro to SharePoint Online Management Shell. The command in this example returns all deleted site collections from the Recycle Bin including Personal Sites.
The following prerequisites need to be executed before going for CRUD operations using CSOM PowerShell on SharePoint online sites. Add the references using the Add-Type command with necessary reference paths. The necessary references are Client.dll, Client.Runtime.dll and Tenant dlls. The path might differ user to user.
The Select Site Collection webpage dialog box appears. In the Web Application list, click Change Web Application. The Select Web Application webpage dialog box appears. Click the name of the web application that contains the site collection that you want to delete.
How long does it take to delete a site in SharePoint?
Before you delete a site collection, ensure that a backup copy of the site collection and all of its contents exists. There are two recycle bins in SharePoint and the retention time for each is as follows: The maximum possible retention time for an item is 30 days.