The official website of Bipul Raman

PowerShell Automation for SharePoint Online

PowerShell based Automations for bulk operations in SharePoint Online using Microsoft PnP Packages. Bulk data is stored in XML or CSV files as per required.

Read here for complete code and instructions:

Performance enhancement tips while using CAML Query in SharePoint

Putting a lot of design customization, custom codes on SharePoint may cause several performance issues. But the main challenge for a developer is to fulfill all the feasible business requirement of client without hitting down the performance. Enhancing performance cannot be done in single step. In fact, at every step of coding you need to take care of it. You need to review every single line of code and justify if it is really needed or can be optimized in other way.

In this article, I will be discussing performance enhancement tips very specific to CAML Query. Whenever you are requesting any data from SharePoint, you use CAML query to filter it based on your parameters. You can use these parameters in CAML Query to enhance the performance.
  • Where : To put conditions or filters such as equals, contains etc.
  • OrderBy : To order the data. Instead of manipulating data later, do it in CAML itself.
  • ViewFields : To load data from selective fields
  • RowLimit : To load data in limited counts
Here is a sample CAML Query which is getting data from a list putting these parameters
  • When List Item Title is equal to 'Test'
  • Ordering data in Ascending Order
  • Loading data for only two fields: 'Title' & 'Code' 
  • Loading only 3 list items
<ViewAttributes Scope="RecursiveAll" />
is used to load data from folders situated inside the lists.

Always remember, this thumb rule while requesting any data from the server
"Request only those data which is really required"

Configuring SharePoint without Active Directory Account

When you are installing SharePoint (2016 or 2013) on your development machine outside any organization's network, you will not be having any Active Directory account to complete the SharePoint configuration wizard. In such scenario, If you try to configure SharePoint, an error will prompt saying that you cannot configure a SharePoint Farm with a local account.

To resolve this issue, there is an interesting and quick solution. You can use below command in SharePoint Management Shell. Please note, always run SharePoint Management Shell in Administrative Mode.

New-SPConfigurationDatabase -localserverrole SingleServerFarm
The New-SPConfigurationDatabase cmdlet creates a new configuration database on the specified database server. This is the central database for a new SharePoint farm.

One you run the above command, It will prompt and ask below parameters (as displayed in the picture):
  • DatabaseName: Configuration Database Name
  • DatabaseServer: SQLServer
  • FarmCredentials: Farm Admin Credentials
  • Passphrase: It can be of your own choice, kind of password

After running the command, Run the SharePoint Configuration wizard, It will automatically select the Farm and Configuration Database and becomes ready to mode to next step.

Note: This method is tested and working for SharePoint 2016 & 2013 both.