0

I am looking for the scenario where no user will be able to delete any of the site in SharePoint Online. How to prevent site deletion in share point online?

  • You need to define "site". Is this a Site Collection or a single site in a Site Collection? – Mike Smith - MCT - MVP Apr 4 '18 at 16:30
  • I want to restrict user from deletion of sub-site in SharePoint Online – Saurabh Jawalekar Apr 10 '18 at 13:58
0

Only site collection administrators have the right to delete the site collections. The best way to prevent users from deleting the site collections is to not provide them the SCA access, instead restrict access to Out of the box groups like owner's, contributors etc.

0

You can go to the site settings->site permissions, create a permission level which untick “Manage Web site” permission. And then grant the custom permission level to the users who you don’t want to delete the site. enter image description here

0

Here is an example to using WebDeleting event to prevent users delete site collection :

public override void WebDeleting(SPWebEventProperties properties)
{
    properties.Status = SPEventReceiverStatus.CancelWithError;
    properties.ErrorMessage = "This site cannot be deleted.";
    properties.Cancel = true;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.