Thursday, November 13, 2014

Upload files and sub folder to SharePoint library from local folder using PowerShell

#Task performed in this PowerShell script.
#Replicate Local folder with subfolder and files in SharePoint document library
#Document Library for uploading files should be alresdy created
#Author : Satish R Gadekar
#Date   : 11/13/2014

Get current site web URL in JavaScript or JQuery

Use JavaScript variable name "L_Menu_BaseUrl" to get current web url and map it to any code in JavaScript.  This variable will be initialized on SharePoint pages by default. Below script will be always there when you do view source of the page:

<script type="text/javascript">

var L_Menu_BaseUrl="/ESearchCenter";
var L_Menu_LCID="1033";
var L_Menu_SiteTheme="";


You can make use of  below variables

1. var webUrl = _spPageContextInfo.webServerRelativeUrl;

2. var siteUrl = _spPageContextInfo.siteServerRelativeUrl;

Monday, September 1, 2014

Come out of PowerShell command more parameter edit mode

Some time in PowerShell we enter some command and keep asking for more input. The easy way to come out of more input prompt is Ctrl+C

Tuesday, August 26, 2014

Step by step - Enable Form based authentication in SharePoint 2010 or SharePoint 2013 (step by step FBA / Claims based authentication)

Finally done :)

I was planning to implement and write a article with screen shots about claims from long time.

Follow below steps to enable Form based authentication in SharePoint 2010 or SharePoint 2013.

Wednesday, August 20, 2014

Change Search tips link from advance search page - SharePoint 2010 Search

<script src="<link to file>jquery-1.11.1.min.js"></script>

$( document ).ready(function() {
$(".ms-advsrchtips" ).find('a').attr("href", "javascript:openDiaFormadvsrchtips();")

Why installing latest CU will not fix your problem?

Today I came across this very good article explaining about CU, Uber (Serve Package), Patch Baselines, PU and Farm patch version information.

Tuesday, June 17, 2014

"An error has occurred" While exporting OOB CEWP (Content editor web part)

Today, I wanted to create a reusable content editor web part. So I thought of crating one and then exporting it and import lator.

But when i clicked on export button on Content editor. It thrown me error as below:

Wednesday, March 26, 2014

Deploy custom BDC model to specific BCS Service / BDC service

SharePoint 2010 Central admin - create new web application screen throws 404 error

We faced this issue today after completing SharePoint 2010 installation on windows 7 machine.

After debugging we found that we were facing this because of Office 2013 installation on system.

So after uninstalling office 2013 the screens started working. :)

SharePoint 2010 central admin showing blank page

One of my team mate faced this issue few days back, After installing SharePoint 2010 when he tried to open central admin he got blank page.

We checked for all app pools and services but everything were fine, But after some googling we found solution that:

He forgotten to tick the Windows Authentication box when installing the IIS7 features. So:

Control Panel > Programs and Features > Turn Windows features on or off >Internet Information Services > World Wide Web Services > Security >tick ‘Windows Authentication’

After doing this our central admin was working as expected

SPDisposeCheck xsl for viewing xml output

XML Structure we get after running SPDisposeCheck command line:

After applying XSL:

How to get this:

SPDisposeCheck codes (Problem ID) table


Run SPDisposeCheck command line SharePoint

1. Run cmd as administrator
2. Navigate to SPDisposeCheck install path i.e. "C:\Program Files (x86)\Microsoft\SharePoint Dispose Check"
3. Run this single command for XML Output i.e.

SPDisposeCheck.exe “C:\FolderPath\Solution.dll” -xml “C:\FolderPath\output.xml“

You can find xml file at specified path.

Event Receivers vs Workflows SharePoint 2010

Event Receivers
Can execute either before or after the operation
Always executes after the operation
Can cancel the operation
Cannot cancel the operation as the item will have already been created
Cannot be launched manually by the user
Can be started manually by the user
Not designed for user interaction
Specifically designed for user interaction
Can execute in response to many different actions, including deletes
Can only execute in response to one of four events – Manual, an item being created, an item being edited, and an item being submitted for approval
Must be created in Visual Studio
Can be created with Visual Studio, Visio or SharePoint Designer

Workflows are mostly used for business process implementation and Event receivers are mostly used for one time activity based on trigger.

What is difference between Event Handler and Event receiver in SharePoint (Event Handler vs Event Receiver in SharePoint)

The below image answers the questions :

According to lot of articles on internet Event handler and Event Receiver are same. In SP2003 it was called as event handler and SP2010 it is called as Event Receiver.

But as per my understanding individual overridden method are called Event Handler and whole class is called Event receiver.

Comment out your thoughts on this.

Wednesday, February 5, 2014

Download WSP file from SharePoint Farm

$farm = Get-SPFarm
$file = $farm.Solutions.Item("branding.wsp").SolutionFile

It will download Solution from SharePoint farm Solution gallary.

SharePoint document metadata not updating

I faced a weird issue today, Metadata for document which has lookup column was not updating even after saving the item. There was no erro...