Reset to Site Definition via PowerShell in SharePoint

To Re-ghost customized SharePoint sites and pages, We use “Revert to Site definition” via Site Settings >> under Site Actions section, click on Reset to site definition  Choose a specific page or entire site. Click on Reset! . Reset to site definition – what does it do?Reset to Site Definition removes any…

Read more

Property Bags in SharePoint 2013 – Store, Retrieve Custom Configurations

As its name suggests, the Property bag feature provides a convenient way to store and retrieve custom configurations, instead of having to store them in web.config files. Property bags in SharePoint store configuration data in the Hash-Table (Key-Value) format. We can store and retrieve properties at the following levels: Farm (SPFarm )…

Read more

Create Permission Level Programmatically in SharePoint

While it’s relatively easy to create permission levels in SharePoint 2010 UI, We had 2000+ site collections in web applications, and a scripting/programmatic way to create permission levels would be the best choice. We wanted to do a SharePoint permission level customization by eliminating delete capability from contributor permission level. Lets copy…

Read more

How to Rename SharePoint Column Programmatically (PowerShell / C#)?

Here is how we can rename SharePoint list or site field or column programmatically with PowerShell and C# object model code: PowerShell script to Rename a SharePoint Field: Rename a SharePoint Field Programmatically (C#): PowerShell to change field display name in SharePoint site collection: Similarly, to rename a site column, use:

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

Create Folders and Sub-Folders in SharePoint Programmatically

How to create Folders in SharePoint 2013? 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…

Read more

How to Create Site Columns Programmatically in SharePoint?

Requirement: Add Site columns to the SharePoint site programmatically as part of a site provisioning code. Add a New Site column to SharePoint Site Programmatically:   Create SharePoint site column programmatically with C# Object Model code: Alternate Approach:

Read more

How to Create – Update – Delete SharePoint Views Programmatically?

Often in development we may have to deal with SharePoint Views programmatically. Here I’m sharing the code snippets from my recent project to handle views programmatically. Creating a New View Programmatically: Add/Remove fields to an existing View Programmatically: Get the Fields from View Programmatically: Delete Existing View Programmatically: PowerShell Script to Create…

Read more

Customize Top Navigation Programmatically in SharePoint

Requirement: Had to customize the Top navigation with bunch of provided internal/external links as part of a branding project. Solution: Designed a feature to programmatically add links to top navigation bar. when activated, feature will add bunch of links to the top navigation bar. Customize navigation programmatically in SharePoint: In another SharePoint…

Read more