Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand

Archive for June, 2013

Squadron – File Lock Finder

Posted by Jean Paul on June 30, 2013

The File Lock add-in allows you to find which process is locking a particular file.

For example: you are working with SharePoint & encountered a check-in problem.  The error message says file is locked.


You can use Squadron to find which process is locking the file.


Open Squadron & use the System add-in from the left pane.


Enter the full file path in the text box, over the bottom.


Click the Find icon to start search.

You will be prompted with the result.


You can terminate the application to release the file lock.

Additional to File Lock finder, the System add-in contains the following panes too:


Here you can find the list of processes currently running.



Here you can find the list of services currently running.



Squadron is a Free Tool & downloadable from following location:

Posted in SharePoint, SharePoint 2010 | Tagged: , , , , | Leave a Comment »

Error : Unable to Delete Site : SharePoint 2010

Posted by Jean Paul on June 28, 2013

I was working on a site moving, but the operation failed due to site template mismatch.  I ended up with a half-created site.

I can access the site through URL, but unable to access the site settings to delete the site.


I tried PowerShell Remove-SPSite approach, but it says it cannot find the site with url.


I tried to examine the problem using Squadron.  Luckily i was able to see the site there.  Then the rest is easy – created on Delete command which recursively delete sites & sub sites under.  It worked like a charm with Squadron.


Here are the steps involved to delete a site collection/site/list/library using Squadron.

Install Squadron

You can download the latest from

Install the application & run it from Start Menu > Programs > Squadron


Open the Explorer plugin from the left pane.


Locate the site to be deleted


Click the Delete button


Confirm site deletion


Great! Your defective site should be deleted now.


Here we have explored a rare scenario of defective site & deletion of it using Squadron.  You can use the tool for site collection deletion, list/library deletion as well

Posted in SharePoint | Tagged: , , , , | Leave a Comment »

SharePoint 2010 – Explorer View – File Lock Error & Solution

Posted by Jean Paul on June 27, 2013

While editing an HTML file in explorer view, following error occurred.


While working with SharePoint 2010 Document Library Explorer View:


My client reported the following error:

The process cannot access the file because it is being used by another process!

He cannot save the file through Notepad/Notepad++ or any other application. 

We confirmed that there are no other application simultaneously working on the file.


When we examined further the Explorer – Preview proven to be culprit.  The Preview was creating another process which adds lock on the file.


Please note that the Preview Handler is based on file type:

  1. For TXT files there are no problems
  2. For HTML files the problem occurs


Close the Explorer Window & Save changes from editor


Close the Preview Pane in Explorer Window

Posted in Uncategorized | Leave a Comment »

SharePoint 2010 – How to get Farm Servers through code?

Posted by Jean Paul on June 27, 2013

In this article we can explore the following code:

· Retrieve Name & Type of all Servers in the Farm


A SharePoint Farm consists of multiple servers with role associated to each. For example a typical 500 user Farm can contain:

1. Web Front End Server

2. Application Server

3. Database Server

4. Email Server

5. Searcy Index Server

Following is a typical output from a Server Farm.



Here we are using Server Object Model code to retrieve the farm information.

For getting Farm instance, we can use the SPFarm.Local property.

using Microsoft.SharePoint.Administration;

SPFarm farm = SPFarm.Local;

For iterating through the servers, we can use the Servers property of Farm object.

foreach (SPServer server in farm.Servers)



For retrieving the Name, Role, Type we can use the instance properties of SPServer.

· server.Name

· server.Role

· server.TypeName

Following is the console application code:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Microsoft.SharePoint;

using Microsoft.SharePoint.Administration;

namespace EnumFarmServers


class Program


static void Main(string[] args)




SPFarm farm = SPFarm.Local;

foreach (SPServer server in farm.Servers)












Central Administration

We can always retrieve this information from Central Administration as well.


The console application source code is attached.


Please note that the above code is integrated with Squadron (Free Administration Tool for SharePoint)


You can download the tool from:



In this article we have explored the C# Server Object Model code to retrieve Farm Server Information. In the real world scenarios we can use this information to quickly understand the server topology.

Posted in SharePoint, SharePoint 2010 | Tagged: , , | Leave a Comment »

Undo Checkout Problem >> Solved through Squadron!

Posted by Jean Paul on June 26, 2013

While working with Document Libraries, once in a while we encounter the following problem:

  1. User A checked out document to a machine
  2. User B cannot check out document until User A
  3. User A cannot remember the machine where the document was checked out
  4. User A cannot undo the check out operation
  5. Now, nobody is able to work on the document


How to solve this?

The preliminary steps to solve the problem is:

Option 1: Go to document library settings & use the Manage files which have no checked in version.


Option 2: Use Squadron > Undo Check Out command

Download Squadron 2010 from following location:

Install Squadron on the server machine.

After installation, open Explorer View, open the document library, point to document & click Undo Check Out option.


If you receive no-errors, then your problem i solved.  Now go back to SharePoint & confirm the document is not checked out.

Option 3: Delete & Create Document

This is a manual approach where we delete the document & re-create it.

Please make sure you save the latest document, all the versions along with comments before the Delete operation.

Option 4: Content Database Approach

You can contact Microsoft Support if you have purchased support hours.  Working directly on content database to modify record status is not advisable.

You can refer this article:

Posted in Uncategorized | 2 Comments »

SharePoint 2010 – Create Site Collection with new Content Database

Posted by Jean Paul on June 12, 2013

In this article I would like to explore the trick that allows Creating Site Collection with New Content Database, everything through Central Administration.


Why a trick?

A trick is needed as the new site collection creation does not allow us to select the content database name. It randomly selects the database & this aspect we need to control.

What are the steps involved?

Following are the steps:

6. Create new content database

7. Make all other databases to offline

8. Create new site collection

9. Ensure new database name

10. Turn back all databases to online

Step 1: Create new content database

Open Central Administration & choose the option Manage content databases.


In the appearing page create a new content database.



Step 2: Make all other databases to offline

Back in the databases list, select all other databases (except NewDb) & make them as Offline.


Then save changes, continue this for all databases except our NewDb. The final list should look like:


Please note that only one database is active now, this will make SharePoint to choose it while creating new site collection.


Step 3: Create new site collection

Now our new content database is created & set to the Started state, we can proceed with creating new site collection. Chose Central Administration > Create site collections link.


Enter the site collection creation parameters and click ok button. Please note that there is no field to specify the content database, it will be automatically taken from the available content database in the background.


Step 4: Ensure new database name

Once the new site collection is created, you can verify the database name. Open Central Administration > Application Management > View all site collections link.


In the appearing site collection list, click on the new site collection, you can see the database name in the right hand side panel.


Please note that the database name is NewDb.

Step 5: Turn back all databases to online

Now we have completed the new site collection creation with new content database name. Please turn back all the content databases to Ready state.

Open Central Administration > Manage content database > choose each > set to Ready state.


After completing the step, you will see all the databases set to online.



Please note that PowerShell command New-SPSite provides the option to specify a content database name.



In this article we have explored a Central Administration route to create new site collection with specified content database.

Posted in Uncategorized | Leave a Comment »

Error :: Cannot start service UserCodeV4!

Posted by Jean Paul on June 10, 2013

Scenario: While deploying solutions using Visual Studio, we may encounter the following error.

Error: Cannot start service UserCodeV4 on computer ‘COMPUTER-NAME’


Description: The service mentioned here is SharePoint Service, not Windows Service. 

Solution: Open Central Administration > Manage Services on Server link


You will get the following page of SharePoint Services.


Among the services locate the Microsoft SharePoint Foundation Sandboxed Code Service, it should be having status Stopped.


Click the Start button to restart the service.

Now, back in your Visual Studio try Deploy operation again.  You should succeed this time.

Posted in Uncategorized | Tagged: , , , , , , | Leave a Comment »

SharePoint 2010 How to enable Key Filter?

Posted by Jean Paul on June 7, 2013

SharePoint contains lot of extra features that requires to be manually enabled. For example, Key Filters is one such feature shown below:


While opening a library we can see the Quick Launch pane contains a new filter section called Key Filter.

What is Key Filter?

Key Filter is a mechanism to filter a very large list or library. We can filter based on the Metadata property or term associated.

How to enable Key Filter?

To enable Key Filter follow the steps below:

Step 1: Open list or library

Open the list or library by clicking the Quick Launch link.


Step 2: Go to library settings

Go to the Library tab > Library settings


Step 3: Click on Metadata navigation settings

In the appearing settings page choose Metadata navigation settings


You will get the following page:


You can choose from Navigation Hierarchies & Key Filters.

1. Navigation Hierarchy allows you to choose from the existing Metadata Terms.

2. Key Filters allow you to choose from existing columns in the list or library.

We are using the second option of Key Filters here.

Step 4: Add filter

From the second section Configure Key Filters, choose the columns & add to right side selected fields:

1. Created By

2. Modified By

3. Movie (Metadata Term)

After adding, the columns looks as below:


Step 5: Save changes

Now save changes by clicking the OK button.


Step 6: Refresh List or Library

Click on the library or list link from the Quick Launch & you can see the Key Filters section in the Quick Launch as shown below:


You can try entering filter values & see the result on the right hand side.


Please note that Movie is a Metadata term which was custom created.



In this article we have explored how to enable Key Filter for SharePoint list or library.

Posted in Uncategorized | 2 Comments »

SharePoint 2010 Terms Creation

Posted by Jean Paul on June 5, 2013

In this article I would like to explore on the Term creation & association aspects.

Term Creation

Following are the summary of activities involved:

1. Create Term Store & Terms

2. Create Library

3. Create Managed Metadata Column

4. Associate Terms

Create Term Store & Terms

We are going to create a Local Term Set, Term Set is a group of Terms & Local denotes the scope of Term Set only to site collection & sub sites.

Open SharePoint site & go to Site Actions > Site Settings > Term store management


You will get the following Term store management Tool as shown below:


Click on the Site Collection item > Context drop down menu > New Term Set item.


In the appearing page, enter the name for term set & press enter key. You can even set the Owner of the term set.


Now again open the Movie context menu & create term as shown below:


Enter the name of the term as shown below, create terms for following items.



If you do not have enough permission, you cannot see the context menu item.

Create Library

Now our Term Store is ready & we are good to create the library. Go ahead and create a new library & name it as Movies.


Create Managed Metadata Column

In the library settings choose create column & add the following column, type as Managed Metadata.

Scroll down & choose the Managed Metadata set.


Click the Ok button to save changes, now you are ready with Library & Term column.

Associate Terms

In this step, we are going to assign term (metadata) along with the movie file (data).

Upload a file & in the appearing dialog you will be able to enter the Term in the Category column.


Please note that there is auto-complete guidance.

On saving the changes, you can see the item as shown below:


This concludes our article on Term Creation & Association.


If you wanted to associate multiple values for a Managed Column, you can achieve this through the Allow Multiple Values for the library column property.



In this article we have explored Term creation & association.

Posted in SharePoint | Tagged: , , , , | Leave a Comment »