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!