Friday, December 14, 2012

Unified Logging Service Event ID:2159 & 5586

Problem:
Recently I was asked to troubleshoot a production issue in SharePoint 2010. The web front end servers event log are flooded with Event 2159 - Unified Logging Service and Event ID 5586 - Unknown SQL Exception 297 occurred...


After some research, some pointed out that issue appear after installed December 2011 Update... Which is truth for my case.

And I find my answer at the second part of Thomas's Blog -
http://sharepoint-kb.blogspot.ca/2012/07/event-2159-5586.html

Resolution:
I have confirmed that in SQL Server Configuration, the Named Pipes under SQL Server Network Configuration is enabled. Then I asked the DBA to run the Query command for account (the account indicated in red in the event log screenshot) in SQL Management Studio.

USE master 
GO 
GRANT VIEW SERVER STATE TO "Domain\UserAccount"
GO 

After that... Event log seem happy ever after...  At least for now...

Hope this help!
Thanks!

Thursday, November 1, 2012

Free Microsoft SharePoint 2010 Ebooks

Just found out a list of SharePoint 2010 ebooks from my lead (Winson Woo).


Deployment guide for SharePoint Server 2010
PDF
EPUB
MOBI

Get started with SharePoint Server 2010
PDF
EPUB
MOBI

Governance guide for Microsoft SharePoint Server 2010
PDF
EPUB
MOBI

Profile synchronization guide for SharePoint Server 2010
PDF
EPUB
MOBI

Configure Kerberos Authentication for SharePoint 2010 Products
DOCX
PDF
EPUB
MOBI

Business continuity management for SharePoint Server 2010
PDF
EPUB
MOBI

Remote BLOB storage for Microsoft SharePoint Server 2010
PDF
EPUB
MOBI

Technical reference for Microsoft SharePoint Server 2010
PDF
EPUB
MOBI
image
Upgrading to SharePoint Server 2010
PDF
EPUB
MOBI
image
Getting Started with SharePoint Server 2010
PDF
DOC
XPS
EPUB
MOBI
image
Planning guide for sites and solutions for Microsoft SharePoint Server 2010, Part 1
PDF
DOC
XPS
image
Planning guide for sites and solutions for Microsoft SharePoint Server 2010, Part 2
PDF
DOC
XPS
image
Planning guide for server farms and environments for Microsoft SharePoint Server 2010
PDF
XPS
DOC

Capacity planning for Microsoft SharePoint Server 2010
PDF
XPS
DOC


This is good stuff, and should save you a buck or two! A more complete list of free Microsoft books can be found at Eric Ligman’s post here.

Thanks Eric and Winson!

Friday, September 14, 2012

Connection Execution Timeout ULS EventID fa45, fa46 tzku, fzkv, and btq8

The last couple days I have been investigating a long thread of event ID  fa45, fa46 tzku, fzkv, and btq8 in the ULS log.

These series of event were begin with EventID fa45, and then escalated to eventid fa46, tzku, fzkv and finally btq8. it was caused by connection execution timeout between SharePoint and SQL server... ULS looks like the example below:-

09/13/2012 14:35:35.37 w3wp.exe (0xF7FC) 0xEE04 SharePoint Foundation Database fa45 High System.Threading.ThreadAbortException: Thread was being aborted.
09/13/2012 14:35:35.39 w3wp.exe (0xF7FC) 0xEE04 SharePoint Foundation Database fa46 High at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean retryfordeadlock)....
09/13/2012 14:35:35.39 w3wp.exe (0xF7FC) 0xEE04 SharePoint Foundation Database tzku High ConnectionString: 'Data Source=sp2010db;Initial Catalog=WSS_Content;Integrated....
09/13/2012 14:35:35.40 w3wp.exe (0xF7FC) 0xEE04 SharePoint Foundation Database tzkv High SqlCommand: 'proc_EnumLists'     CommandType: StoredProcedure CommandTimeout: ....
09/13/2012 14:35:35.40 w3wp.exe (0xF7FC) 0xEE04 SharePoint Foundation Database btq8 High System.Threading.ThreadAbortException: Thread was being aborted.

This happened when there was a large query execution on a site (resource intensive query in a custom built webpart). Look closer into the code, I found recursive code that loop through the entire site and tried to fine a specific object in the site. The process took longer than the expected as a result of connection execution timeout error. The issue never appear before the migration, after the full migration, the objects on the site double, and require longer time to complete the query.

While this custom webpart does not execute frequently, so instead of rewrite the code, all I need to do is extending the connection timeout value between SharePoint and SQL Server. By default the connection timeout value is 120 seconds (2 minutes).  For my case, I increased the value to 300 seconds (5 minutes) and it solved my problem, and here is how.

Open the web.config file of the SharePoint site.
At the end of <httpHandlers/> Search for this blog of code (see below), and add the executionTimeout=”300” attribute to extend the timeout value

<httpHandlers />
<customErrors mode="On" />
<httpRuntime maxRequestLength="51200" executionTimeout="300" />
<authentication mode="Windows" />

Once the web.config is saved, the site will be reset… and these series of error should go away.

Please backup your web.config before making change. Good Luck!

Hope this help...Thanks!

Note:- Recursive function is not recommended for looping thru. the entire site, because it causes stack overflow when the stack reach it limited. the follow article in Code Project show you how to replace recursive function with while loop to avoid the stack-overflow

Tuesday, September 11, 2012

Free Microsoft Developer Training Kits (SharePoint)

SharePoint 2010 and Windows Phone 7 Training Kit
Provides developers with advanced guidance on how to develop Windows Phone 7 Applications for SharePoint.
Release Date:7/22/2011

SharePoint and Windows Azure Development Kit
The July 2011 release of the SharePoint and Azure Development Kit is a training course to help developers integrate SharePoint and Windows Azure.
Release Date:7/15/2011

Office 365 Developer Training Kit – June 2011 Update
Guidance that provides developers with advanced guidance on how to develop for Office 365 including SharePoint Online, Exchange Online and Lync Online
Release Date:6/28/2011

SharePoint and Silverlight Training Kit
Provides developers with advanced guidance on how to develop Silverlight Applications for SharePoint.
Release Date:4/7/2011

SharePoint 2010 Developer Training Kit
Guidance that provides developers with advanced guidance on how to develop for SharePoint.
Release Date:5/8/2010

Other Free Microsoft Developer Training Kits can be found here.

Thanks!

Thursday, August 16, 2012

How to tune SharePoint 2010 for better performance?

Just stumbled to this site, where Chaitu outlined each area that require attention for performance tuning, it is worth sharing...
So check it out when you have a moment.
http://www.chaitumadala.com/2012/01/how-to-tune-sharepoint-2010-server-for.html

Thanks

Wednesday, August 1, 2012

SharePoint 2013 Training and walk through videos

Lots SharePoint 2013 goodies

IT pro-focused how-to training and walk through videos with this interactive course about SharePoint 2013...
http://technet.microsoft.com/en-US/sharepoint/fp123606

Developer Training and walk through videos
http://msdn.microsoft.com/en-US/office/apps/fp123626

Friday, July 20, 2012

Joel Oleson and Michael Noel were in Calgary

No a technical post…
If you have been following SharePoint Joel Blog, probably know about this.

The two SharePoint MVPs Superstars were in town! Joel and his family is visiting southern Alberta, it is the first time they come to Calgary. Michael Noel flew in to join for him for the Banff National Park tour; this is Michael second visit to Calgary after 27 years. These two travel bees have been to hundreds to countries and countless cities… We are very lucky that they actually put Calgary into their travel map :)

Both Michael and Joel dropped by and gave Calgary SharePoint Usergroup(Calspug) a great presentation. First 30 minutes, Michael was presenting SQL 2012 new feature – AlwaysOn, and how this feature has been further enhanced to support SharePoint and provide the highest server Service Level Agreement (SLA), this feature is also simple to set up and running in SQL 2012, I could see the great benefit of this feature for couple of my projects.

Then SharePoint Joel was presenting Social Intranets – The SharePoint and Yammer Evolution, he shown us the project he has been working on and how Yammer plug-in to SharePoint and plays an important role for collaboration, sharing content and search… With the recent news of Microsoft acquired Yammers, Joel offers some high level insight view of how Yammer will soon play a major in Microsoft stack.

Overall, a great session for the Calgary SharePoint User Group. Not too lengthy and straight to the point.

Another highlight was the “SharePints”! The opportunity to hang out with the superstars for the evening, and heard them sharing their personal and professional life. Down to earth, friendly, approachable and absolutely great people!
Bil Simser and Michael Noel

Jay O'Hara and Joel Oleson

Group picture
Nice to meet you guys! Enjoy your trip in Banff and Calgary!

Tuesday, July 10, 2012

Opening .Msg and .Pdf files in Browser


Challenge
We have a problem in our environment that .MSG file and .PDF documents will be prompt to download before you can open them…  Here are the screen shots that made the users mad! 


Option 1
The common solution is changing the Browser file handling from "strict" to "permissive"…
  • Go to Central Administration > Manage Web Applications > Your WebApp > General Settings
  • Change Browser file handling from "strict" to "permissive"

Unfortunately, it does not work for me.

Option 2
So I tried second approach, add the correct MIME type to IIS for both .msg files and .PDF files.
  • Start Internet Information Manager
  • Select the server node in the left pane, pick your web application.
  • in Right Panel, Open in the MIME Types settings, click add.
  • Enter .msg for file name extension and application/vnd.ms-outlook
  • Repeat for all front end servers


Then run the following script

##============================================================================##
## Allowed Inline Downloaded MimeType for .Msg (Outlook) and .PDF in IIS
## Version: 1.0
## Last updated: 7 July, 2012
## Description: This script add value in AllowedInlineDownloadedMimeTypes for
## .msg files and PDF files
## Reference: http://ianankers.wordpress.com/author/ianankers/page/2/
##==============================================================================#

## Add .Msg (Outlook file type)
$webApp = Get-SPWebApplication http://yourspweburl
If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains "application/vnd.ms-outlook")
{
  $webApp.AllowedInlineDownloadedMimeTypes.Add("application/vnd.ms-outlook")
  $webApp.Update()
  Write-Host "application/vnd.ms-outlook added to AllowedInlineDownloadedMimeTypes"
}

## Add .Pdf
If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains "application/pdf")
{
  $webApp.AllowedInlineDownloadedMimeTypes.Add("application/pdf")
  $webApp.Update()
  Write-Host "application/pdf added to AllowedInlineDownloadedMimeTypes"
}

Well I have tried it and it does not work for me again…

Option 3 (Finally – This work!)
Third tried - Further investigation, it turned out that the web site was created using the previously saved template; the template was created when the web application had 'Browser File Handling' set to 'Strict'. So changing the 'Browser File Handling' in Web Application will have no effect on these sub sites.

The situation has pointed out exactly as Craig Lussier mentioned in his response in the Forums

So here is powershell script that should rescue you from the situation.
##============================================================================##
## PowerShell to Set the 'Browser File Handling' setting to 'Permissive'
## Version: 1.0
## Last updated: 7 July, 2012
## Description: This script will set BrowserFileHandling to "Permissive" for
## specific a document library
## Reference: http://ianankers.wordpress.com/author/ianankers/page/2/
##==============================================================================#

#Get Web
$web = Get-SPWeb "http://yourspweburl"

#Get Document Library
$docLib = $web.lists["Document Library"]

#View all properties/methods of the Document Library and you'll see that BrowserFileHandling is a property
$docLib | Get-Member

#See the current BrowserFileHandling setting for the Document Library
$docLib.BrowserFileHandling

#If you need to change it from Strict to Permissive
$docLib.BrowserFileHandling = "Permissive"
$docLib.Update()

After the executed the script, I clicked on the .Msg file, Voilà! The "Open" button shows up, 

and when I clicked on the PDF, the browser simply open the PDF without a prompt.


Update: 12 Nov 2012, 
Just stumbled to NICO's blog, where he created a nice script and log the changes as well.
http://gallery.technet.microsoft.com/office/Change-Browser-File-e60b46c9

Here is the script

param  

[string] $URL, 
[boolean] $writeToFile = $true 

#Change Browser File Handling for all lists and libraries in SharePoint 2010 farm 
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue 

#Counter variables 
$webcount = 0 
$listcount = 0 

if($writeToFile -eq $true) 

$outputPath = Read-Host "Outputpath (e.g. C:\directory\filename.txt)" 


if(!$URL) 

#Grab all webs 
$webs = (Get-SPSite -limit all | Get-SPWeb -Limit all -ErrorAction SilentlyContinue) 

else 

$webs = Get-SPWeb $URL 

     
if($webs.count -ge 1 -OR $webs.count -eq $null) 

    foreach($web in $webs) 
    { 
    #Grab all lists in the current web that have the "Strict" Browser file handling 
    $lists = $web.Lists | ?{$_.BrowserFileHandling -eq "Strict"} 
    #If there are lists that have the strict browserfilehandling 
        if(-not(!$lists)) 
        { 
        Write-Host "Website"$web.url -ForegroundColor Green   
        if($writeToFile -eq $true){Add-Content -Path $outputPath -Value "Website $($web.url)"} 
            foreach($list in $lists) 
            {  
            #Change the browser file handling to permissive 
            $list.BrowserFileHandling = "Permissive"  
            $list.Update() 
            $listcount +=1 
            Write-Host " - "$list.Title updated           
            if($WriteToFile -eq $true){Add-Content -Path $outputPath -Value " - $($list.Title) updated"} 
            } 
    $webcount +=1 
    $web.Dispose() 
        } 
    } 
#Show total counter for checked webs & lists 
Write-Host "Amount of webs that were updated:"$webcount 
Write-Host "Amount of lists updated:"$listcount 
if($WriteToFile -eq $true){Add-Content -Path $outputPath -Value "Amount of webs updated:$($webcount)"; Add-Content -Path $outputPath -Value "Amount of lists updated: $($listcount)"} 

else 

Write-Host "No webs retrieved, please check your permissions" -ForegroundColor Red -BackgroundColor Black 
}

Well hope this help! Thanks!

Thursday, July 5, 2012

Disabled Content Organizer - SharePoint 2010

If Content Organizer is enabled in your site, you will see a "Drop Off Library" document library either in your left Nav or when you are in All Site Content.


Disabled the feature in Site Settings does not remove the library. and you can't simply delete "Drop Off Library" because the "Delete this document library" link is not available when you are in the "Library Settings"... so how to delete this library?

Here is the PowerShell script that should save your day.

Powershell Script:

##=======================================================================================##
## PowerShell Disabled Content Organizer and delete "Drop Of Library" 
## Version: 1.0
## Last updated: 30 June, 2012
## Description: This script will loop through all the subsites in site collection 
##  and disable the Content Organizer Feature then remove the "Drop off Library"
## Reference: http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/ff72703e-9ba0-4dc2-8221-ccda3529183d
##=======================================================================================##

if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
 Add-PSSnapin Microsoft.SharePoint.PowerShell;
}

Get-SPSite -Identity http://yoursitecollectionurl | Get-SPWeb -Limit ALL | ForEach-Object { 
  Disable-SPFeature –Identity DocumentRouting –url $_.Url –Confirm:$false
  $dropOffLibrary = $_.Lists["Drop Off Library"]
  $dropOffLibrary.AllowDeletion = "True"
  $dropOffLibrary.Update()
  $dropOffLibrary.Delete()
}

Hope this help!
Thanks

Wednesday, June 6, 2012

SharePoint new folder end with additional underscore

SharePoint has a logic to prevent user from using some of the reserved words as folder names (e.g._file, _files, .files).  So when you create a new folder with “_files” in the folder name in any document library, SharePoint will insert a “_” at the end.

For example, if your folder name is “Releases_files”, if you create this folder in any document library via browser or code, the result will be “Releases_files_”.

The work around is make sure there is no “_files” in your folder name, such as “files” or “-files” will work just fine. Apparently this “feature” has been around since MOSS 2007 or could be earlier, I did not know about it until this week, when one of our document migration code failed…

Found my answer through this link, http://objectmix.com/sharepoint/357916-appending-_-foldername-ending-_files.html

Thanks!

Monday, April 23, 2012

Could not find stored procedure ‘dbo.Search_GetRecentStats’, Event ID 5586 and 6398

In one of my new farm, I noticed two errors repeated themselves in the Event log every minute... One Critical (Event ID 6398), another Error (Event ID 5586), both complaint the same thing:
 "Could not find stored procedure ‘dbo.Search_GetRecentStats’"

Then I found my solution from Andrew Toh SharePoint Adventures Site - Event 6398 and 5586 SharePoint Foundation

Health Data Collection is not enabled. Do the following to enable this service.

  • Central Admin > Monitoring > Configure Usage and Health Data Collection.
  • On the page, make sure the "Enable Usage Data Collection" and " Enable Health Data Collection" are checked. 



If they are checked, make sure you reset them (uncheck them, click OK, come back the recheck them). Then your problem should be solved... 

Some time, I wonder if I could ever solve this issue without other help... because both errors do not mentioned or indicated anything about Health Data Collection... 
So Thanks Andrew! 

Friday, April 20, 2012

Start SharePoint Central Admin Service in Powershell

The other day, instead of reset (Stop and then Start again) the Business Data Connectivity Service in Services on Server page, I accidentally stop the Central Administration Service (well we are all human...) So I turned to PowerShell again...


List all SharePoint Services on the Server

Get-SPServiceInstance


To Start and Stop a SharePoont service you need

Start-SPServiceInstance [GUID] -Confirm


Stop-SPServiceInstance [GUID] -Confirm


Or You can pipe the Service Name to filter the Type Name and confirm your action.

Get-SPServiceInstance | Where-Object {$_.TypeName –eq ‘Central Administration’} |  Start-SPServiceInstance -Confirm


This should save a day :)

Thursday, April 12, 2012

Remove SharePoint Service Application Pool


Problem:
I have been monkeying with the Search Service Application for the last couple days. From create new, to delete, and then re-create new one again in a different name... Then I noticed, when I delete the Service Application, it does not delete the Service Application Pool that previously created or associated with it.

So the previous entries are still in the Service App Pool, and the Service App Pool list is getting longer. when I check the IIS, all I see lots of GUID entries in the Service App Pool... I am nervous of removing GUID in the Service App Pool from IIS without knowing the App Pool Name of the GUID.

Resolution:
Then I turned my search to PowerShell and found a proper solution to remove the Service Application Pool...

First list all the Service Applications with the following cmdlet 
Get-SPServiceApplicationPool | Select Id, Name

* You will need the Service App Pool Name when you are moving the Service App Pool in PowerShell, and the ID, when you remove the Service App Pool from IIS Manager.

Second, remove the Service Application in PowerShell
Remove-SPServiceApplicationPool

Example:


Finally, find the ID in IIS Manager Application Pool, and remove the guid entry from there, if there application associate with the app pool, IIS will stop you from removing the entry.

That's it... 
Note : This is not a problem in SharePoint, because the App Pool can be shared by other applications as well, so removal process will require additional care and love...


SharePoint 2010 Search Comparison

There were time I was asked to present the different version of Search in SharePoint, there tons comparison information in the web, but some of them breakdown too much for non technical / business user to consume, so I decided to simplify a version that is easy to read, also provide a link for more details only if user is interested.

A simplify comparison table of SharePoint Foundation Vs Standard Vs FAST


Features
SharePoint Foundation 2010
SharePoint Server 2010
FAST Search 2010 for SharePoint
Basic site search
Y
Y
Y
Visual Best Bets
Limited
Y
Search Scopes
Y
Y
Search Enhancement Based on User Context
Y
Crawl and Index Custom Properties
Y
Y
Property Extraction and Managed Properties
Limited
Y
Query Federation
Y
Y
Query Suggestions
Y
Y
Similar Results
Y
Sort Results on Managed Properties or Rank Profiles
Y
Relevancy Tuning by Document or Site Promotions
Limited
Y
Shallow Results Refinement
Y
Y
Deep Results Refinement
Y
Document Preview (Word, Excel, Powerpoint)
Y
Windows 7 Federation
Y
Y
People Search
Y
Y
Social Search
Y
Y
Taxonomy Integration
Y
Y
Multi-Tenant Hosting
Y
Rich Web Indexing Support
Y


From a more reliable source I found in TechNet - By Vedant Kulshreshtha
http://blogs.technet.com/b/vedant/archive/2009/10/23/search-technologies-for-sharepoint-2010-products.aspx

Thanks!

Tuesday, April 10, 2012

Configure Search in your Non Domain Standalone DEV Machine


If your SharePoint DEV environment is a non domain on a single machine (or a VM) like the one described in  my post about SharePoint 2010 standard/enterprise with SQL 2008 R2 on a single machine (standalone);

Your SharePoint Search in this DEV is likely not working, then I found a great post from Søren Nielsen, he created a very neat script that setup the Enterprise Search in your DEV environment "automagically"!

Follow the "Search Fix" section, you will find the handy script, and it work like a charm!

How to install a SharePoint 2010 Complete (Dev) Server without AD - By Søren Nielsen

Also check out
How to install and configure a standalone Sharepoint 2010 Server By Srikanth Nair

Many thanks to both Søren Nielsen and Srikanth Nair for Sharing the knowledge!