Jean Paul's Blog

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

    Advertisements
  • 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
  • Advertisements

Archive for June, 2013

Squadron – File Lock Finder

Posted by 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.

image

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

Squadron

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

image

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

image

Click the Find icon to start search.

You will be prompted with the result.

image

You can terminate the application to release the file lock.

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

Processes

Here you can find the list of processes currently running.

image

Services

Here you can find the list of services currently running.

image

Summary

Squadron is a Free Tool & downloadable from following location:

http://www.sharepointcto.com/Squadron/Default.aspx

Advertisements

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

Error : Unable to Delete Site : SharePoint 2010

Posted by 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.

image

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

Solution

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.

Steps

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

Install Squadron

You can download the latest from http://www.sharepointcto.com/Squadron/

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

image

Open the Explorer plugin from the left pane.

image

Locate the site to be deleted

image

Click the Delete button

image

Confirm site deletion

image

Great! Your defective site should be deleted now.

Summary

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 Paul on June 27, 2013

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

image

While working with SharePoint 2010 Document Library Explorer View:

image 

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.

Solution

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

image

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

Solution

Close the Explorer Window & Save changes from editor

or

Close the Preview Pane in Explorer Window

Posted in Uncategorized | Leave a Comment »

SharePoint 2010 – How to get Farm Servers through code?

Posted by Paul on June 27, 2013

In this article we can explore the following code:

· Retrieve Name & Type of all Servers in the Farm

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.

image

Code

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)

{

SPSecurity.RunWithElevatedPrivileges(delegate()

{

SPFarm farm = SPFarm.Local;

foreach (SPServer server in farm.Servers)

{

Console.WriteLine(server.Name);

Console.WriteLine(server.Role);

Console.WriteLine(server.TypeName);

Console.WriteLine();

}

});

Console.ReadKey(false);

}

}

}

Central Administration

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

image

The console application source code is attached.

Squadron

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

image

You can download the tool from:

http://www.sharepointcto.com/Squadron/Default.aspx

References

http://www.sharepointcto.com/Squadron/Default.aspx

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spserver.aspx

Summary

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 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

image

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.

image

Option 2: Use Squadron > Undo Check Out command

Download Squadron 2010 from following location:

http://www.sharepointcto.com/Squadron/Default.aspx

Install Squadron on the server machine.

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

image

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: http://www.codeproject.com/Articles/251161/Resolve-SharePoint-Document-Locked-for-Editing-Iss

Posted in Uncategorized | 2 Comments »

SharePoint 2010 – Create Site Collection with new Content Database

Posted by 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.

image

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.

clip_image003[7]

In the appearing page create a new content database.

clip_image004[7]

clip_image005[7]

Step 2: Make all other databases to offline

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

clip_image006[7]

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

clip_image022

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

image

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.

clip_image010[7]

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.

clip_image023

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.

clip_image024

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

clip_image025

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.

clip_image017[7]

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

image

clip_image026

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

References

http://technet.microsoft.com/en-us/library/ff607937.aspx

Summary

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 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’

image

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

Solution: Open Central Administration > Manage Services on Server link

image

You will get the following page of SharePoint Services.

image

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

image

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 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:

image 

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.

clip_image004

Step 2: Go to library settings

Go to the Library tab > Library settings

clip_image006

Step 3: Click on Metadata navigation settings

In the appearing settings page choose Metadata navigation settings

clip_image008

You will get the following page:

clip_image010

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:

clip_image012

Step 5: Save changes

Now save changes by clicking the OK button.

clip_image014

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:

clip_image015

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

clip_image017

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

References

http://bit.ly/18U1GP1

Summary

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 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

clip_image002

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

clip_image004

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

clip_image006

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

clip_image008

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

clip_image010

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

clip_image011

clip_image013

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.

clip_image015

Create Managed Metadata Column

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

clip_image016
Scroll down & choose the Managed Metadata set.

clip_image018

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.

clip_image020

Please note that there is auto-complete guidance.

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

clip_image022

This concludes our article on Term Creation & Association.

clip_image013[1]

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.

References

http://bit.ly/10uiVpB

Summary

In this article we have explored Term creation & association.

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