Disable "Delete this site" option
-
Monday, February 08, 2010 4:48 PMHi,
Is there a way to disable "Delete this site" option from site collection and sub sites under it, so no user can delete the site.
I want even site admin cannot delete the site, please suggest the way out.- Moved by Mike Walsh FIN Friday, February 19, 2010 5:05 AM cust q (From:SharePoint - Enterprise Content Management (pre-SharePoint 2010))
All Replies
-
Tuesday, February 09, 2010 12:24 PM
you can use custom Event Receiver: http://www.lcbridge.nl/download/seventreg.htm
or http://www.codeplex.com/governance/Release/ProjectReleases.aspx?ReleaseId=3830 -
Tuesday, February 09, 2010 2:59 PMThanks for the update Ivan, is it possible to freez "Delete this site" option for every site collections and sub-sites under it, by just changing the master page or making some changes on central admin? As i have no idea of deployment, can you please help with some quick eazy steps that i could follow to freez this or can you please provide me step by step deployment instructions? Thanks in Advance!!
-
Tuesday, February 09, 2010 5:06 PM
Hi,
You can do this really easily by just using a feature with a HideCustomAction as below. Because I scoped the feature as WebApplication, you can activate the feature in Central Admin and it will hide the delete this site link for all sites in the web application.
Feature.xml
<Feature Id="{DBB60F9B-C30C-430c-B129-E943A9607ABC}" Title="Hide Delete Web" Description="Hide the delete this site link on the site settings page" Version="1.0.0.0" Hidden="FALSE" Scope="WebApplication" xmlns="http://schemas.microsoft.com/sharepoint/"> <ElementManifests> <ElementManifest Location="elements.xml"/> </ElementManifests> </Feature>
Elements.xml
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <HideCustomAction Id="HideDeleteWeb" GroupId="SiteAdministration" HideActionId="DeleteWeb" Location="Microsoft.SharePoint.SiteSettings"> </HideCustomAction> </Elements>
- Marked As Answer by Lu Zou-MSFT Wednesday, February 10, 2010 9:33 AM
-
Wednesday, February 10, 2010 3:25 PMHi Paul, This is really interesting and eazy way to do. Can you please send me the detailed instructions, where to make chenges and how to activate this. Where can i find these files and how to activate this feature in central admin. Please send in me the detailed instruction os aman.kumar08@hotmail.com Also, one quick question, is GUID provided by you in the feature.xml, remain the same? Thanks in advance!!
- Edited by AmanKu Wednesday, February 10, 2010 3:51 PM add something
-
Wednesday, February 10, 2010 7:09 PMHi,
Sure. there are a couple of options for deployment. The best one is to package this feature into a Solution Package (wsp). There are plenty of articles on the web with instructions on how to do this, and there are a number of different methods and tools you can use.
However, the quickest and easiest (to explain) way to get this deployed is to create the feature manually, as follows.
1. On your SharePoint server, browse to the folder C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES
2. Create a new folder called HideDeleteWeb
3. Create two files in that new folder, one called feature.xml, the other called elements.xml
4. Paste the xml code from my previous post into the respective xml files. You can leave the guid as is. I generated that when I created the sample.
5. Open a windows command prompt, so that you can install the feature.
6. Type the following at the command prompt
stsadm -o installfeature -name HideDeleteWeb
7. You should get a message that the operation completes successfully
8. Browse to SharePoint Central admin website, then Web Application Management -> Web Application Features
9. You should see the Hide Delete Web Feature which you can activate on a web application. -
Wednesday, January 26, 2011 7:23 PM
hi,
I got this working in MOSS2007 but not in SharePoint 2010. I thought perhaps the GroupID is different in 2010, but after i changed it in SiteActions still no result. Can you help me? Thanks in advance!!
-
Tuesday, May 17, 2011 4:23 PM
Hi Paul,
Thank you for the detailed steps :-).
I was able to perform the same on SharePoint 2007.As per Chris could you please provide us with the ID for SharePoint 2010?
Would appreciate, if you could let us know how and where to get the ID information (for future reference).
Thanks,
Satyam
Live life king size -
Thursday, April 05, 2012 2:23 PM
The ID information is on this page:
http://msdn.microsoft.com/en-us/library/bb802730.aspx
I cant get it work either, on a subsite that's based on a usersolution, is this the problem? because i've read that HideUserActions doesn't work on sandboxed solutions.
Is a UserSolution a sandboxed solution?
-
Thursday, April 12, 2012 11:25 PM
The ID information is on this page:
http://msdn.microsoft.com/en-us/library/bb802730.aspx
I cant get it work either, on a subsite that's based on a usersolution, is this the problem? because i've read that HideUserActions doesn't work on sandboxed solutions.
Is a UserSolution a sandboxed solution?
The GroupId is incorrect, SiteAdministration must be replaced by SiteTask,
see for the correct GroupId's the file setting.xml in folder:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\SiteSettings
- Edited by Rietveat Thursday, April 12, 2012 11:25 PM

