What is SPContext in SharePoint?

SPContext is often used with custom web parts and pages to retrieve SharePoint site objects from the context of the SharePoint site accessed. Its a good practice to use SPContext instead of creating new objects (So that we can avoid disposal of objects). SPContext object will be available for access in our…

Read more

Workflows Inventory Report for SharePoint

Requirement: Get me a SharePoint Workflows Report with the Total No. of workflows wherever it’s running, for our intranet SharePoint site with Site Name, List Name, Workflow Name, and No. of Instances, etc. Solution: As usual, dive into the object model code (This can be achieved with PowerShell as well). Here it…

Read more

Version History Size Report for Entire SharePoint Web Application

Ever wanted to get a report on versioning sizes on SharePoint? Unlimited No. of versions enabled in various document library across web application. As part of regular auditing, wanted to generate report for the entire web application ,with Number of versions, Amount of storage consumed by versions. Of course there are some…

Read more

Find Large Lists & Generate Report in SharePoint

Requirement: SharePoint was running with serious performance issues and wanted to get the report, where more than 2000 items stored in List/Library for the entire web application. When users store a large number of items in a List or Library, SharePoint will definitely run into serious performance issues. This script will generate…

Read more

How to send E-Mail using SPUtility.SendEmail in SharePoint?

SharePoint SPUtility class has SendEmail method which is used to send email to any email address. By default, SPUtility.SendEmail() method picks the ‘From address’ from Outgoing E-Mail Settings in Central administration. Use SPUtility.IsEmailServerSet method to check if server is configured with SMTP mail settings. Here is a C# Example for sending E-mail…

Read more

How to Hide User Names in Created by, Modified by Fields in SharePoint?

Requirement:  Had to provide complete anonymous entries in SharePoint task list by masking user names (as in SharePoint Surveys). Here is the Trick: There is a Property for SharePoint List, called “ShowUser”. we can set that to “False” using PowerShell or C# object model. PowerShell script to Hide User Names in SharePoint:…

Read more

Find All Incoming E-Mail Enabled Lists and Libraries in SharePoint

Requirement: During Migration, Needed a List of location where Incoming E-Mail is enabled. So Here is the script which gives that! PowerShell Script to find all incoming Email Enabled Lists and Libraries: Here is the PowerShell script to find all incoming email enabled lists in a SharePoint web application. Get All Incoming…

Read more