29

Can I prevent a user from deleting his MySite?

Stu Pegg
  • 4,623
  • 7
  • 48
  • 91
Flo
  • 1,330
  • 12
  • 22

5 Answers5

15

Another option would be to develop an event receiver for the 'site is being deleted' event and have it canceled.
You can also decide whether you want to show an error message to the user (like: 'you cannot delete your own site!') or not.

You can find some more information on event receivers on Building SharePoint Event Receivers in 2010 post from SharePoint Happenings blog.
Johnny Tordgeman
  • 766
  • 6
  • 16
12

You might be able to modify the permissions at the web application level through Central Admin.

Manage Web Applications > User Permissions

However, this will limit what the site collection administrator can do on his own site.

Here is a possible code solution to stop the WebDeleting event: https://stackoverflow.com/questions/1137445/how-to-prevent-a-mysite-owner-form-deleting-the-mysite-root-website

Laurie
  • 5,197
  • 1
  • 19
  • 26
6

Users are granted site collection administrator rights to their My Site, so they'll have the ability to do so. Aside from training and making sure the sites are backed up routinely, I'm not sure there is anything else that can be done.

Some of the developers round here might have event receiver ideas.

And as Lori mentioned, you can fiddle with the web application permissions, but this would also prevent users from deleting any subsites they create in their My Site.

Eric Alexander
  • 43,293
  • 10
  • 53
  • 93
4

Along the lines of what Eric suggests: You could implement the Site Recycle Bin that is available from Microsoft (supports both sites and site collections). This way if a site was deleted, it could get undeleted again.

Anders Rask
  • 17,949
  • 3
  • 38
  • 71
3

If the mysites are in a different web application than other team or publishing sites, you could consider adjusting the web application user permissions to remove the ability to delete the site.

Lori
  • 4,863
  • 16
  • 14
  • You mean by policy? I wonder if that would interfer with the fact that users are site collection administrator on their own site – Anders Rask May 05 '11 at 16:30