Set SharePoint Search Settings (Search Center URL, Scope Dropdown Mode) Programmatically

After migrating SharePoint 2007 sites to SharePoint 2010, we decided to set search center URL to a Enterprise Search center site and scope settings Dropdown mode to use “Show scopes dropdown” for all site collections. To update search center and search scope dropdown settings in SharePoint sites, We used to go: Site…

Read more

Hide Links in Site Settings Page with HideCustomAction

Problem: People make SharePoint branding inconsistent by creating and applying random themes and breaks corporate branding. So need to stop users from creating & uploading new themes and applying them. How to Hide Links in Site Settings page using CustomAction? Hide Themes and Site Themes links with “HideCustomAction” from Site Settings! Some…

Read more

SharePoint Document Versions Size Report with PowerShell

This is a PowerShell version of my existing post Version History Size Report for SharePoint which uses C# object model to generate a versioning report and gives insights, such as: Site/Library’s Total versions size Total No. of versions created Which documents are with more versions Type of the documents Library in which…

Read more

Change Site Collection Primary, Secondary Administrators in SharePoint

Site collection administrators have god-like power within a SharePoint site collection, They can add/delete sites, content, users, etc for any site within a site collection. These administrators are responsible for administering their site collection and are recipients of any site status and resourcing Email notifications. How to change the site collection administrator…

Read more

Hide Columns in SharePoint List NewForm, EditForm and DispForms

Had a requirement to hide a specific column “Parent Project” in a SharePoint list “Project Metrics”, Since this field was being updated by an internal workflow, it must not be visible in NewForm or in EditForm. So to protect a particular column from edits, decided to hide it from New & Display…

Read more

Delete All Items from List or Library using PowerShell

At times, we may have to delete all items from SharePoint list or library. We can get it done by going to “Manage Content and Structure” option as in my another article How to Remove All responses from SharePoint Survey There may be situations, where we’ve to delete all items from SharePoint…

Read more

Pick the right w3wp.exe to attach among Multiple Worker processes while debugging

When multiple web applications running with multiple application pools, they will create multiple worker processes (W3WP.exe). While debugging code from Visual Studio, we got to pick the one that belongs to the target web application, otherwise, the debugger will not stop on break-points! Don’t forget to select “Show processes from all users”,…

Read more

Create Folders and Sub-Folders in SharePoint Programmatically

How to create Folders in SharePoint? To create a folder in SharePoint list or Library, follow these steps: Navigate to your SharePoint list or library From the “Files” tab on the Ribbon, click on the “New Folder” button Give a name to your new folder and click “Save” What if you don’t…

Read more

Get SPWeb Object from the URL

PowerShell Snap-in for SharePoint 2010 offers Get-SPWeb cmdlet to get SPWeb Object directly from the given web URL. But when writing .Net code in C# (or in PowerShell with MOSS 2007) SharePoint object model doesn’t offer this mechanism. However there is a Trick to get SPWeb Object from given URL: Get the…

Read more

SharePoint Developer Dashboard – FAQs

This article is to answer some of the Frequently asked questions on SharePoint developer dashboard. What is Developer Dashboard in SharePoint? The developer dashboard is a new feature introduced in SharePoint 2010 to monitor and debug the performance on a page-by-page basis. Remember the old days, when it was too difficult in…

Read more