Enable “Save Site As Template” option on SharePont (online) website through Javascript.

You can simply copy this in any browser tool like firebug and run the below script by calling ChangeSharePointPropery() function.

var clientContext;
var web;
function ChangeSharePointPropery() {
clientContext = new SP.ClientContext('/sites/DevApps/ProjectSiteTemplate/');
this.web = clientContext.get_web();
var webProperties = web.get_allProperties();
webProperties.set_item("SaveSiteAsTemplateEnabled", "true");
Function.createDelegate(this, onSuccess),
Function.createDelegate(this, onFail)
function onSuccess(sender, args) {
function onFail(sender, args) {

How to display a message when no results are returned by the Content by Query Web Part (CBQWP)

Johnny Harbieh Blog on Productivity, Collaboration, and Cloud

Hi all,
Hope you are having a good break over this holiday season.
Say you have a Content By Query Web Part (CBQWP) that is configured to display new Pages in the pages library. And you defined "new" by calculating Today minus 7 days. Now it’s the New Year and several weeks have passed without any new Pages being added to that library. People on vacation… You’re half asleep and you need to quickly wake up before Microsoft goes live with Office 14 🙂 I don’t know, there could be a million reasons why this incredibly new SharePoint site is getting old and fresh content seems to be scarce. So you’re up now and you started to notice that your CBQWP has no items displayed. No rows or results are being returned by its query.
What are we going to do? It looks like we need some sort…

View original post 405 more words

POWER OF LOVE – A Letter by Ms. Sudha Murthy.

eRecruit Staffing Solutions | HRM


It was in Pune that I met Narayan Murty through my friend Prasanna who is now the Wipro chief, who was also training in Telco(TataMotors) . Most of the books that Prasanna lent me had Murty’s name on them which meant that I had a preconceived image of the man. Contrary to expectation, Murty was shy,bespectacled and an introvert. When he invited us for dinner. I was a bit taken aback as I thought the young man was making a very fast move. I refused since I was the only girl in the group. But Murty was relentless and we all decided to meet for dinner the next day at 7.30 p.m .. at Green Fields hotel on the Main Road ,Pune.

The next day I went there at 7′ o ! clock since I had to go to the tailor near the hotel. And what do I see? Mr…

View original post 1,631 more words

Delete item working from ribbon but giving access denied from context menu in SharePoint 2010

Nice post on rare issue.

Purnil Soni's TechnologyZen

SharePoint Access Denied DialogSharepoint provides two ways a user can delete an item from any list:

  1. From “Delete Item” menu option available in ribbon
  2. From “Delete Item” menu option available in the item’s context menu

Now you may think that both these options are just alias of one another, i.e. do the same thing the same way which is to delete the item, and must be implemented the same way.

But that is not the case. Both are implemented differently, i.e. both these options use different route of accessing the delete functionality on server. The context menu option uses remoting where as the ribbon option doesnot. So due to this, though you may have given “Delete Items” permission on the list, you need to provide one more permission, “Use Remote Interfaces”, to allow successful deletion from delete item option available from an item’s context menu. Not providing this second permission would lead to a condition where in…

View original post 82 more words

SharePoint Server 2013 Production Farm Deployment

In this article, I am going to walk you through step by step instructions for setting up the SharePoint Server 2013 Production Farm in Lab Environment.

You can skip the steps you are already comfortable with.

This article is divided into several parts.

Part 01: Operating System Installation for SharePoint Servers.

Part 02: Active Directory and domain controller Server Configuration.


Part 01: Operating System Installation for SharePoint Servers.



Work In Progress

Part 01: Operating System Installation for SharePoint Servers

This article is Part 01 of article series “SharePoint 2013 Production Farm Deployment”.

We need server operating systems to be installed on SharePoint servers. For SharePoint installation we need to install either Windows Server 2008 R2 SP1 or Windows Server 2012.

For this demonstration, we are going to install Windows Server 2012 Standard Edition with GUI.


Make sure that Windows Server 2012 Media disk is mounted. Boot your computer through above media and follow the below steps to install it.

1. Please wait while the setup copies required files.

2. Select Language to Install, Time and currency format and input method. In my case, I have accepted the defaults and clicked next.

3. Click on Install now Button.

4. Please wait while the setup starts.

5. Select the edition you want to install. I have selected Windows Server 2012 Standard (Server with a GUI).

6. Accept license terms and click on Next.

7. Since we are installing fresh OS, click Custom: Install Windows Only (advanced).

8. Here you can select the partition on which to install the operating system. Also you have different drive options such as format, etc. Since I have only one drive, I select that and click on Next.

9. Please wait while the setup install windows on your system.

10. The setup will restart your computer.

11. Please wait while the setup is processing the device related operations.

12. Set password for local administrator of this computer and click on Finish.

13. Please wait while settings are being finalized.

14. Press Ctrl+Alt+Delete to log onto the computer.

15. Type password for the local administrator account and hit enter.

16. It will load personal settings for this user and open Server Manager for you.

17. Congratulations! The Windows Server 2012 Operating System is setup successfully.

SharePoint Easy Copy or Move Files in Document Library

By default there is no convenient option available out of the box to move or copy files across different folders inside a library. Though you can use explorer view but it is not available in all scenarios especially when ribbon is hidden and you are using list view webpart to see the library.

I have created a project on codeplex called “SPEasyCopy” to resolve these issues.

In nutshell, this project allows easy moving and copying documents inside SharePoint document library.

Project Features

1. Easy document item menu options to copy and move files.

Custom Copy & Move Actions

Custom Copy & Move Actions

2. User can navigate easily between different folders in a library to locate the target folder.

Select Target Folder

Select Target Folder

3. No need to download files and upload again to copy same to different folder.
4. Explorer view is not required for copy & move operations.
5. No need to use manage site content and structure option just to copy few files in library.


Rahul Babar

How to add custom list/library event receiver using PowerShell

Sometimes we provision event receiver on a particular list or library. But later on if the requirement may come for another list/library to have the same event receiver. Below is the PowerShell script to add same event receiver to another list/library.

#For item Added

$spWeb = Get-SPWeb -Identity http://spserver/sites/Training
$spList = $spWeb.Lists["MyList"]
$spEventReceiver = $spList.EventReceivers.Add()
$spEventReceiver.Assembly = "SharePoint.MyProject, Version=, Culture=neutral, PublicKeyToken=8b0aa81a0704748b"
$spEventReceiver.Class = "SharePoint.MyProject.MyEventReceiverClass"
$spEventReceiver.Type = 10001
$spEventReceiver.SequenceNumber = 1001
$spEventReceiver.Synchronization = 2

Here is the list of other event receiver types for reference.

enum SPEventReceiverType
        InvalidReceiver         = -1,
        ItemAdding              = 1,
        ItemUpdating            = 2,
        ItemDeleting            = 3,
        ItemCheckingIn          = 4,
        ItemCheckingOut         = 5,
        ItemUncheckingOut       = 6,
        ItemAttachmentAdding    = 7,
        ItemAttachmentDeleting  = 8,
        ItemFileMoving          = 9,
        FieldAdding             = 101,
        FieldUpdating           = 102,
        FieldDeleting           = 103,
        ListAdding              = 104,
        ListDeleting            = 105,
        SiteDeleting            = 201,
        WebDeleting             = 202,
        WebMoving               = 203,
        WebAdding               = 204,
        WorkflowStarting        = 501,
        ItemAdded               = 10001,
        ItemUpdated             = 10002,
        ItemDeleted             = 10003,
        ItemCheckedIn           = 10004,
        ItemCheckedOut          = 10005,
        ItemUncheckedOut        = 10006,
        ItemAttachmentAdded     = 10007,
        ItemAttachmentDeleted   = 10008,
        ItemFileMoved           = 10009,
        ItemFileConverted       = 10010,
        FieldAdded              = 10101,
        FieldUpdated            = 10102,
        FieldDeleted            = 10103,
        ListAdded               = 10104,
        ListDeleted             = 10105,
        SiteDeleted             = 10201,
        WebDeleted              = 10202,
        WebMoved                = 10203,
        WebProvisioned          = 10204,
        WorkflowStarted         = 10501,
        WorkflowPostponed       = 10502,
        WorkflowCompleted       = 10503,
        EmailReceived           = 20000,
        ContextEvent            = 32766

Rahul Babar

Best way to troubleshoot 404 The resource cannot be found error in SharePoint

Whenever SharePoint is not able to find certain resourse in a website, it gives HTTP 404 error with below message.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Here is the screenshot of the error message.

404 the resource can not be found

404 the resource can not be found

Problem with this error is even if you turn off the customerrors mode in web.config and set debug=true and callstack=true in web.config, the detailed error may not get displayed on the page itself.


Best way to troubleshoot and find the solution for this is to right click on the page with above error and select page source. Go at the bottom of the page and here you will find the detailed error in commented source. It will clearly show which file is missing and will lead to some definite direction.


For me it was the issue with master page url. I was setting the master page as

web.MasterUrl = /_catalogs/masterpage/My_Master.master”;

It was working fine with top level site collection. But for the site collections with url as http://sp2010server/sites/, it was giving 404 resource can not be found error.

From the page source above I got the idea to change the code as below and it solved the issue.

web.MasterUrl = rootWeb.Site.ServerRelativeUrl + “/_catalogs/masterpage/Piramal_Admin_Master.master”;


Rahul Babar