Have you tried the Merge-SPLogFile command when troubleshooting?

When troubleshooting SharePoint issues, the best way to filter out all the noise from your log files and sort it for easier troubleshooting is to use the ULS Log viewer tool.

Refer to my blog post on the ULS Log viewer comparison and verdict to get a feel for the other options and see how I got to my conclusion there. http://www.jeremytaylor.net/2012/07/14/sharepoint-uls-log-viewer-tool-comparison-and-verdict/

However, this ULS Log viewer tool does not display logs from other servers in the SharePoint farm, unless obviously its a single server farm.

The way to help you with a multiserver farm is to run the Merge-SPLogFile command in the SharePoint management shell. This command “merges” all logs from other servers in the farm and combines them into one ULS log file on the local server. That file can then be opened in your favourite ULS log viewer for troubleshooting.

Note: this works in both SharePoint 2013 and SharePoint 2010.

So how do we use it?

Here is an example of how I use it to grab all logs between say 10AM and 10:30AM on the 23rd July 2013:

Merge-SPLogFile -Path "D:\Temp\MergedLog-20130723-1000-1030.log" -StartTime "23/07/2013 10:00:00" -EndTime "23/07/2013 10:30:00"

If I know the correlation ID, then I would recommend you run the following command after updating it to your correlation ID:

Merge-SPLogFile -Path D:\Temp\MergedLog-419ac99c-81b2-0077-378d-3c23767d2955.log -Correlation 419ac99c-81b2-0077-378d-3c23767d2955

 

 

2014-11-07_10-39-43

Merge-SPLogFile looks across all the servers in the farm, aggregates the logs with the correlation ID and creates the aggregated .log file.

The merged log file containing only the  information you specified and require. In this case, a certain correlation ID.

The merged log file containing only the information you specified and require. In this case, a certain correlation ID.

 

Open the log file up in ULSViewer!

Open the log file up in ULSViewer!

 

There are a lot more examples of what you can do with Merge-SPLogFile you can get by typing this in the SharePoint management shell:

Get-help Merge-SPLogFile -examples Continue reading 

SharePoint Backup and Restore best practices

Some time ago, I was collecting some Backup & Restore best practices for SharePoint and I came across this post.

It talks about various aspects of backup and restore for a SharePoint farm. Its based on SharePoint 2010 but can be applied to SharePoint 2013.

  • IIS Configurations required in a Disaster Recovery
  • Backup Scenarios
  • Restore Scenarios
  • SQL Backup maintenance plans
  • Overview of monitoring with SCOM (System Center Operations Manager)
  • DPM (System Center Data Protection Manager)

Worth a look: http://blogs.technet.com/b/surama/archive/2012/05/29/sharepoint-2010-backup-and-restore-best-practices.aspx


Host Named Site Collections SharePoint 2013

Here is a summary of the steps to create a new Host Named Site Collection (HNSC)

  • Create a new Web Application – default Web App on port 80 or use an existing Web Application.  I chose http://HNSCWebApp as my Web Application – the default Web App listening on port 80 on all my Web servers in the farm.
  • Note – HNSC can be created on a non default Web Application but you’ll need to add bindings in IIS for your HNSC as the Web Application isn’t listening to all port 80 requests and would need to know about the HNSC it hosts. Thats why a lot of blogs usually specify HNSCs on default web apps, because adding IIS bindings can get messy. But its worth a note in this post.
  • Decide what your new Site Collection unique URL should be. I chose http://test and http://teamsite to run off a Team Site template.
  • Run the following in the SharePoint Management Shell:
$w = Get-SPWebApplication http://hnscwebapp
New-SPSite http://test -OwnerAlias "testdomain\testowner" -HostHeaderWebApplication $w -Name "test" -Template "STS#0"
New-SPSite http://teamsite -OwnerAlias "testdomain\testowner" -HostHeaderWebApplication $w -Name "teamsite" -Template "STS#0"
  • Ensure that you create a dummy ‘root’ site collection with a site template http://hnscwebapp. Its required for Search & Send to Other location.
  • Configure kerberos for your Host Name site collection.
  • Create a Managed Path if required (New-SPManagedPath)
  • You can create new zones for HNSC so that it can be accessible via a different name.

 

My recommended links for you to read:

Wicto Wilen – Clearing up the confusion with Host Named site collections and Path Based site collections
http://www.wictorwilen.se/clearing-up-the-confusion-with-host-named-site-collections-and-path-based-site-collections

Marko Rosberg – For more information on creating Host Named Site Collections  and App host configuration:
http://www.sharepointblues.com/2012/11/22/configurin-sharepoint-2013-host-named-site-collections-and-apps-host

Kirk Evans – Host Named Sited Collection in SharePoint 2010 (applies to SharePoint 2013):
http://blogs.msdn.com/b/kaevans/archive/2012/03/27/what-every-sharepoint-admin-needs-to-know-about-host-named-site-collections.aspx

Technet – Host-named site collection architecture and deployment (SharePoint 2013):
http://technet.microsoft.com/en-us/library/cc424952.aspx

Brian Farnhill – Multiple zones for host named site collections in SP2013
http://blogs.msdn.com/b/brian_farnhill/archive/2014/07/08/multiple-zones-for-host-named-site-collections-in-sp2013.aspx


Export migrate all wsp solutions from your SharePoint farm

A few recent migrations I worked on required me to export and import all Farm Solutions from one SharePoint farm to another SharePoint farm. There are a few blogs and tools available to get this done.

However, I came across Shane Young’s brilliant one line PowerShell command to get the job done!

 

Export all of the Solutions from your farm:

(Get-SPFarm).Solutions | ForEach-Object{$var = (Get-Location).Path + "\" + $_.Name; $_.SolutionFile.SaveAs($var)}

 

Import all of the Solution into another farm

Get-ChildItem | ForEach-Object{Add-SPSolution -LiteralPath $_.Fullname}

Note: Shane’s blogpost has the third step to deploy all these solutions. Not all Web Applications may need to have farm solutions deployed to them. So – you might want to plan this one, rather than deploy all these solutions in one go.

 

Check out Shane’s blogpost:
http://msmvps.com/blogs/shane/archive/2011/05/05/using-powershell-to-export-all-solutions-from-your-sharepoint-2010-farm-and-other-fun.aspx


SharePoint Webcast update

I had an overwhelming response for this webcast. 25 registrations were received in 48 hours.

Please note:  I have now decided to move away from ‘Teamviewer’ which had a 25 participant maximum to another webcast/webinar provider. The new one has the capacity to house 100 participants. It also has better Audio options (international call in numbers, voip, skype integration or a ‘call me’ option for US numbers).

What this means is you will have to disregard the meeting links that were sent to you on your registration (if you registered).
You will be sent new links in a weeks time.

Everything else remains the same. Just the online meeting links will be different.

Additionally, you will be sent the online meeting information and reminders a few days before the Webcast.

For more information click here:
Troubleshooting SharePoint 2010 issues. Webcast by JeremyTaylor.net


SharePoint Webcast – Troubleshooting SharePoint 2010 issues

Topic: Troubleshooting SharePoint 2010 issues

Special coverage on SharePoint 2013!

A problem well defined is a problem half solved! Explore the various steps to troubleshooting SharePoint issues, learn more on tools, tips and tricks to help you quickly narrow down your issue and find a fix.

This event is only limited to 100 attendees, so hurry and register now.

Date: Wednesday, 8 August 2012

Time: 5:30 PM to 6:30 PM (GMT+10)

Total Duration: 1 hour

This includes –
Presentation: 45 minutes
Demo, Q & A: 15 minutes

Go here for more details: www.jeremytaylor.net/webcast