Month: November 2012

SharePoint 2010 change permissions on lists using Powershell

It might getting interesting if your customer needs functionalitiy like freeze or publish documents, whole site or webs or just special lists. If the process needs something that can stop users from being able to edit or delete items, lists or do anything in the current site. You have many options for this: create an…

SharePoint 2010 Delete items from List by using C#

If you want to delete all items in a list or empty / truncate the list by using c# you might be interested in this small script: SPList targetList = web.GetList(SPUrlUtility.CombineUrl(web.ServerRelativeUrl, "/Lists/YourList")); SPList delList = web.GetList(SPUrlUtility.CombineUrl(web.ServerRelativeUrl, "/Lists/YourList")); //If list is empty, do nothing, otherwise delete all items if (targetList.ItemCount > 0) { foreach(SPListItem delItem in…