Thursday, January 19, 2012

Tool to find the error message related to Correlation ID in SharePoint 2010

In SharePoint 2010 whenever you face an error, SharePoint will display a web page with a plain error message. That is "An unexpected error has occurred." and a Correlation ID.

An unexpected error has occurred

So have you ever wondered what is "Correlation ID" and I am pretty sure that Correlation ID will not make any sense to you.

So what is this Correlation ID? In SharePoint 2010, you get a Correlation ID (which is a GUID) attached to your logs/error messages when something happens. This ID can then be used to look up that specific error from the logs.

This Correlation ID is used per request-session in SharePoint 2010, and if you are in the process of requesting some information from SharePoint and bump into some problems along the way – your Correlation ID will be the best starting point for searching for what went wrong along that request.

With the help of SharePoint 2010 Management Shell, you can examine that specific Correlation ID and find out more information about it. Since I hate to open Management Shell and run some scripts every time I ran into these type of errors, I thought of writing a simple tool which will present me the error message details when I entered a Correlation ID.

Error Message From Correlation ID

What I did was pretty simple. I have created an simple Windows Application which will invoke the SharePoint 2010 Management Shell, run the script with a given Correlation ID and return the output. It's that much easy.

You all can try this simple tool your self.
     free download

We always develop tools for others and why not develop tools for our selves to make our life easy. Appreciate your feedback.

Happy Coding.


Wednesday, January 18, 2012

Installed Microsoft SharePoint Server 2010 on Windows 7

Last week I have installed Microsoft SharePoint Foundation 2010 on Windows 7. For the last two days I was thinking why not give a try to install SharePoint Server 2010 and today I installed SharePoint Server 2010 Enterprise on my Windows 7.

I removed SharePoint Foundation 2010 and installed the SharePoint server. Installation went smoothly, and I was following the steps which was on my previous post about Installing Microsoft SharePoint Foundation 2010 on Windows 7.

SharePoint Server 2010 on Windows 7

Happy Coding.


Friday, January 13, 2012

Installing Microsoft SharePoint Foundation 2010 on Windows 7

Since I am also working on Microsoft SharePoint Server and I am enjoying writing custom code for SharePoint, I always wanted to have some version of Microsoft SharePoint Server running in my physical computer. I have both Microsoft SharePoint Server 2010 and Microsoft SharePoint Foundation 2010 installed on two different virtual machines which has Microsoft Windows Server 2008 r2 running. So when I want to write some code on SharePoint, I had to switch on a virtual machine. Since my Dell has only 4GB of RAM, it takes a lot of time to switch on a virtual machine and I am lacking patience.

So I thought of installing Microsoft SharePoint Foundation 2010 on my Windows 7 Ultimate which has Microsoft SQL Server 2008 R2 already installed. First I thought it will be a easy thing, but trust me it's not sweet as it seems. So I am going to write down some few things which I am sure you will find helpful.

First thing is we need to do some changes to SharePointFoundation.exe before running it. Because when you download and run the SharePointFoundation.exe, you will see this setup error message.

Setup Error
To avoid this error, we need to modify the SharePointFoundation.exe. Let's say I have copied my initial SharePointFoundation.exe file to"C:\MySharePointFiles". We can do this by extracting the exe and changing the installation configuration file which will be in "c:\MySharePointFiles\files\Setup\config.xml".

To extract the exe, in your command prompt type,
c:\SharePointFiles\SharePointFoundation.exe /extract:c:\MySharePointFiles
Add this line inside the <configuration> tag in config.xml.
<Setting Id="AllowWindowsClientInstall" Value="True"/>
Now you will not face any setup error. Next thing to notice is when you run PrerequisiteInstaller.exe, it will say this message which is "This tool does not support the current operating system.". So we will have to install the prerequisites manually if you don't already have them.

After installing prerequisites and installing SharePoint Foundation, I started configuration wizard. I have selected "Server Farm" and selected "Complete" as my Server Type. Then after filling out next screens and when I started configuration, I got an error saying I am trying to start configuration with an local user account. It's a pretty clean error message, because I am trying to make an installation on my Windows 7 which has no Active Directory.

But there is a workaround for this problem. That is with the help of SharePoint 2010 Management Shell which was installed during SharePoint Foundation installation. Open SharePoint 2010 Management Shell and run the New-SPConfigurationDatabase command with the appropriate parameters.
New-SPConfigurationDatabase -DatabaseName "SharePoint2010_Config" -DatabaseServer "Ravana" -AdministrationContentDatabaseName "SharePoint2010_Admin_Content" -Passphrase (ConvertTo-SecureString "P@ssw0rd" -AsPlaintext -Force) -FarmCredentials (Get-Credential)
This command will prompt you a Window PowerShell Credential Request to enter your username and password. Make sure to enter the username as "computername\username". Then  I got this error,
New-SPConfigurationDatabase : Could not load file or assembly 'Microsoft.Identi
tyModel, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The system cannot find the file specified.
At line:1 char:28
+ New-SPConfigurationDatabase <<<<  -DatabaseName "SharePoint2010_Config" -Data
baseServer "Ravana" -AdministrationContentDatabaseName "SharePoint2010_Admin_Co
ntent" -Passphrase (ConvertTo-SecureString "P@ssw0rd" -AsPlaintext -Force) -Far
mCredentials (Get-Credential)
    + CategoryInfo          : InvalidData: (Microsoft.Share...urationDatabase:
   SPCmdletNewSPConfigurationDatabase) [New-SPConfigurationDatabase], FileNot
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPCon
It says it can't load the assembly "Microsoft.IdentityModel". I examined my assembly directory which is "C:\Windows\assembly". Microsoft.IdentityModel assembly was already there. Then what I did was pretty simple. I removed the Windows Identity Foundation I already had and installed the appropriate file I got downloaded from following link and restarted the machine.
     Download Windows Identity Foundation

Now again I ran the above SharePoint 2010 Management Shell command, and now the command got completed successfully. Then I started the configuration wizard again and this time it went smoothly and completed.

After successful configuration, I thought of creating a new web application from my SharePoint 2010 Central Administration. When I went to Manage Web Applications page and for my surprise "New" in the ribbon was disabled. I ran my browser as administrator and it was still disabled. To fix this what I did was "changing user account control settings to never". You can do that by going through,
control panel->user accounts->change user account control settings->never 
And now everything was perfectly working. Hope you found this post helpful. Appreciate your feedback.

Happy Coding.


Thursday, January 12, 2012

Microsoft SQL Server 2012

Today I am going to write my first post in this year and it's about Microsoft SQL Server code name 'Denali'. Microsoft has released SQL Server 2012 RC0.

I am pretty sure you must be wondering what is RC0. RC0 stands for 'Release Candidate 0'. The term release candidate (RC) refers to a version with potential to be a final product, which is ready to release unless fatal bugs emerge. In this stage of product stabilization, all product features have been designed, coded and tested through one or more beta cycles with no known showstopper-class bug.

So Microsoft has made available a release candidate of Microsoft SQL Server 2012, considering it "production ready". Microsoft referred this new version as SQL Server Code Named "Denali", but has settled on SQL Server 2012 as the final name for the product.

There are many new features in this release throughout all components, including the Database Engine, the Analysis, Integration, Reporting and Master Data Services, but the SQL Server Team Blog has outlined 5 of them considered as most important:
  • Greater availability : Deliver the required 9s and data protection with AlwaysOn, delivering added functionality over CTP3 that allows customers to experience multiple, readable secondaries for distributed scale of reporting and backup workloads and support for FileTable and FILESTREAM which brings first-class HA to complex data types.
  • Blazing-fast performance  :  More effectively govern performance in multi-tenancy environments like private cloud. Resource Governor enhancements include support for 64 resource pools, greater CPU usage control, and resource pool affinity for partitioning of physical resources and predictable resource allocation.
  • Rapid data exploration  :  Empower end users with new insights through rapid data exploration and visualization. Discover new insights at the speed of thought with more feature/functionality in Power View, the highly interactive, familiar browser-based data exploration, visualization, and presentation experience for end users.
  • Credible, consistent data  :  In addition to CTP3 functionality delivered for Data Quality Services and Master Data Services, customers can better support heterogeneous data within Data Warehouses through new Change Data Capture (CDC) support for Oracle.
  • Optimized productivity  :  Optimize IT and developer productivity across server and cloud with the new SQL Server Data Tools, a unified development experience for database and business intelligence projects, and cloud-ready capabilities within SQL Server Management Studio for snapshot backups to the Windows Azure Platform. Additionally, SQL Server 2012 offers a new version of Express – LocalDB. SQL Express LocalDB is a lightweight version of Express with all its programmability features, yet runs in user mode with a fast, zero-configuration installation and short list of pre-requisites.

The product will come in 3 main editions: Standard, Business Intelligence and Enterprise. Here is a feature comparison among the three main editions.

Feature comparison - SQL Server 2012 Editions

For more information,
     Microsoft SQL Server 2012
     What's New in SQL Server 2012 RC 0
     SQL Server 2012 Editions

Happy Coding.