All posts by Bob Mixon

Senior SharePoint Solution Architect, Senior Information Architect, 5-year Microsoft SharePoint MVP (2006, 2007, 2008, 2009, 2010). Family man, father, grandfather and cook. You can read my entire profile here.

Debugging SharePoint Issues and ULS Log Files

I often see administrators and developers new to SharePoint find debugging difficult and complex.

When working with SharePoint, log files are your friend.  In large on-premise farms, locating issues within large log files can be time consuming and sometimes difficult.

When I am presented with an error that contains a correlation ID, I first resort to PowerShell instead of a ULS Viewer.

Two PowerShell cmdlets that are your friend are: Get-SPLogEvent and Merge-SPLogFile.

Before you can use these cmdlets in your PowerShell scripts, make sure to load the SharePoint PowerShell snapin.

if((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null)
{
    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
}

Get-SPLogEvent

The Get-SPLogEvent cmdlet will retrieve specific events from a ULS Log File.  For example, the following call will retrieve all entries that occurred during a specified time range:

Get-SPLogEvent -StartTime "12/04/2007 17:00" -EndTime "12/04/2007 18:00"

If you wish to retrieve ULS entries associated with a specific correlation ID, you can use the following:

Get-SPLogEvent | ? {$_.Correlation -eq "<Correlation ID>"} | Select Area, Category, Level, EventID, Message

Where <Correlation ID> is the id you wish to filter.

If you wish to display the results in a nicely formatted list, add Format-List:

Get-SPLogEvent | ? {$_.Correlation -eq "<Correlation ID>"} | Select Area, Category, Level, EventID, Message | Format-List

Be patient when running the Get-SPLogEvent cmdlet as it can take quite a long time to traverse through all the ULS log files.

I have a diagnostics PowerShell library that contains many functions that simplify diagnosing issues, writing log files, etc.  One of the functions in this library is my Get-SPLogEventByCorrelationID.  Which simply calls the Get-SPLogEvent cmdlet and filters the results by a specified correlation ID.

function Get-SPLogEventByCorrelationID
{
    [CmdletBinding()]
    Param([Parameter(Mandatory=$true)]
        [string]$CorrelationID
    )
    $logEntries = Get-SPLogEvent | ? {$_.Correlation -eq $CorrelationID} | Select Area, Category, Level, EventID, Message
    return($logEntries)
}

For more information on using the Get-SPLogEvent cmdlet, see the following:

Merge-SPLogFile

The Merge-SPLogFile cmdlet combines ULS log entries, from all servers in a SharePoint farm, to a single (specified) log file.

The following example will merge all ULS log files for the last hour:

Merge-SPLogFile -Path "C:\Logs\FarmMergedLog.log" -Overwrite

If you wish to merge all ULS log events for a specific correlation ID, you can use the following call:

Merge-SPLogFile -Path "C:\Logs\FarmMergedLog.log" -Correlation "<Correlation ID>" -Overwrite

Where <Correlation ID> is the id you wish to filter.

As with the Get-SPLogFile, I have included some common functions in my diagnostics library.  One that I use on a regular basis is Merge-SPLogFileByCorrelationID

function Merge-SPLogFileByCorrelationID
{
    [CmdletBinding()]
    Param(
        [Parameter(Mandatory=$true)]
            [string]$CorrelationID,
        [Parameter(Mandatory=$false)]
            [bool]$Overwrite=$false,
        [Parameter(Mandatory=$false)]
            [int]$LeadingSpaceCount=0
)

    $ls = "".PadRight($LeadingSpaceCount," ")
    $diagConfig = Get-SPDiagnosticConfig
    $ulsLogLocation = $diagConfig.LogLocation + "\MergeLog-Correlation (" + $CorrelationID + ").log"
    Write-Verbose ([string]::Format("$ls- Writing merged logs to file [{0}].", $ulsLogLocation))
    if($Overwrite)
    {
        Merge-SPLogFile -Path $ulsLogLocation -Correlation $CorrelationID -Overwrite
    }
    else
    {
        Merge-SPLogFile -Path $ulsLogLocation -Correlation $CorrelationID
    }
}

Other References

Conclusion

With a little knowledge and tools, you can become efficient at debugging issues in SharePoint.  If you would like a copy of my diagnostic script, please contact me; I will be happy to send it to you.

Happy SharePointing!

Perfect Breakfast Potatoes

I was eating brunch at a restaurant, in Fresno, this last week and breakfast potatoes that were hard and seemed undone.  If you have ever had this problem with your potatoes, here is a guide for making the perfect potatoes.

This technique doesn’t have to be just for breakfast potatoes, I use it for scalloped potatoes, au gratin potatoes and for many other recipes.

The primary key is to boil your potatoes first.  Which leads me to another (related) topic.

Water for Boiling

Many home cooks don’t realize the flavor you can incorporate in to foods when boiling.  There aren’t many vegetables I boil, but when I do, I always season my water.  Yes, that’s right; season the water.  At a minimum, always include salt in your water.

When I am parboiling potatoes, I include Thyme, Rosemary, Garlic and Onion.

I will dice 1/2 a yellow (Spanish) onion and 4 garlic cloves.  For boiling water, I use dry Thyme and Rosemary.

2015-07-25 10.31.18

Remember, you can use any spices and herbs you wish to impart in to the food you are boiling.

2015-07-25 10.31.26

Potatoes

I usually boil potatoes for 15 to 20 minutes allowing them to get soft but still firm.  Remember we are parboiling them.

Once complete, immediately transfer them to a colander and allow them to drain.  Don’t rinse them as this would make them soggy and remove the dry spices/herbs you added to the water.

I prepare my frying pan with about 1 tbsp butter and 2 tbsp peanut oil.  For this application, peanut oil or avocado oil is best because they have a higher smoke point.  If you want a nice crisp on your potatoes, which is my favorite, avoid olive oil as it has a very low smoke/burn point.

Bring the oil to a high heat.  You want to see the oil/butter glisten.  Then toss in the potatoes.

2015-07-25 10.46.05

Notice all of the herbs still on the potatoes?  ~yum~

Add a liberal amount of salt and allow the potatoes to become crispy.  Don’t add pepper yet.  Did you know that pepper will burn and become bitter?

In a saute pan, cook the other half yellow onion and another 2 (finely chopped) garlic cloves.

At this point you can also saute red and green bell peppers if you wish.  In addition, feel free to experiment; cook some fresh chorizo, linguica, bacon, ham, pancetta, or anything else you would like with your potatoes.

Once your potatoes are nice a brown, add the saute onion and garlic, toss to incorporate.

2015-07-25 10.58.52

At this point, your dog(s) may join you in the kitchen, begging for a nibble!

2015-07-25 10.58.59

Potatoes aren’t difficult to cook at all.  The key is a few simple techniques and the result will be crispy on the outside, delicious and tender on the inside morsels of yummy potatoes.

Serve them with an omelet and you have a perfect breakfast.

2015-07-25 11.04.52

Until next time!

AutoSPInstaller: SharePoint 2013 March 10, 2015 CU (KB2956166)

The AutoSPInstaller tool is not something I’ve written about in the past.  I’m not sure why because its a fantastic tool and I use it on a regular basis.  In general, it is a PowerShell based SharePoint installation tool.  If you are unfamiliar with it, I do recommend you take a look at it here.

I use AutoSPInstaller to build SharePoint farms including the creation of web applications, site collections, installation of PU’s and CU’s, etc.  The beauty of using a scripted approach is its consistent.  If your farm ever burns to the ground, its a way to rebuild it just as it was.

I recently used AutoSPInstaller to build a SharePoint 2013 farm for a client.  We then made the decision to install SharePoint 2013 March 10, 2015 CU.  As with all farm-level modifications I make, I added this CU to the AutoSPInstaller updates directory then ran the installer again.  It ran the CU, psconfig and ensured the farm was in an operational state.  It worked flawlessly!

To accomplish this, download the (3) SharePoint 2013 March 10, 2015 CU installation files from the Microsoft site and place them in the SP\AutoSPInstaller\2013\Updates directory.  You then run the launch script again, on all servers, and the cumulative update will be installed for you.  In addition, the script will run psconfig; so you don’t need to do than manually!

Split Pea Soup

There have been a few times in my life when I ask “where have you been all my life?”.  Okay, okay its happened more than once.  But my point is, why do I wait so long before I make this soup?  Sure, I live in Arizona now, and its hot; but who cares?  Peas and ham make a perfect relationship; and I’m always looking for a new relationship…

Today’s relationship is about peas and ham… ~yummm~

So here it is…

When you decide to make this, sit outside, relax and enjoy!

Ingredients

16oz Pachage Your favorite Dried Split Peas
Whatever you do, don’t use cheap split peas!
4 cups Water
3 Large Russet Potatoes
Peeled and cubed
2 Large Yellow Onions
Small dice
2 Carrots
Fine dice
4 cups Ham
Yes, include the ham bone too!
1/2 cup Diced celery
4 cups Chicken broth
1 teaspoon Dried marjoram
1 teaspoon Poultry seasoning
1 teaspoon Dried sage
1 teaspoon Fresh cracked pepper
1/2 teaspoon Dried basil
1/2 teaspoon Salt

Directions

I know, your split pea package says, no soaking necessary.  I don’t buy it.  I soak them for about 4 hours before I do anything with them.  Makes them nice and tender.

Combine all ingredients in a large pot.  Bring to a boil.  Once you have it boiling, turn the heat down to a low simmer.  Let simmer, stirring every now and then, for 2 hours.

Enjoy!

Evolution of SharePoint

Interesting article, from Julia White, general manager for the Office Product Management team, about the Evolution of SharePoint.  Exciting times ahead!

Excerpt from Intro:

“In the conversations I have with customers and partners, I’m often asked how SharePoint will evolve in Office 365, and what the future holds for SharePoint on-premises. As we move into 2015, continue to roll out new innovation within Office 365, and get closer to the next on-premises server release, I wanted to take this time to provide full context about the road ahead.

When we started this journey, SharePoint began as a content collaboration solution focused on team sites. As the product evolved, we added new experiences such as portals, search, business intelligence (BI) and enterprise content management (ECM). Across all of these experiences, SharePoint offers a consistent management layer providing control to customers. We also made SharePoint an extensible platform, allowing customers and partners to enhance the out-of-box experiences. Experiences, management and extensibility became the core aspects of what people love about SharePoint. As we move SharePoint forward, these three aspects continue to remain central—both within the server and across Office 365.

The cloud enables us to bring the experiences, management and extensibility together across not just SharePoint, but all of the Office technologies. We can finally break down individual product installations into a cohesive productivity solution, enabling holistic capabilities that provide greater value to customers and partners. The cloud also allows us to rapidly innovate and deliver new experiences faster than ever before. At the same time, we’re building collaboration, mobility and machine learning capabilities right into all of the Office experiences, enabling a generational transformation in the way people work.”

Good read if you are interested in learning more about the future of SharePoint and Office 365.

Lightning Conductor 2013 and Aggregating Form Library Content

I have been working with the new Lightning Conductor 2013 content roll-up web part recently, specifically the new custom column abilities. This web part allows you to add a custom column to a view and it can contain any jscript and CSOM. This opens up a new world of possibilities.

If you are unfamiliar with the Lightning Conductor 2013 roll-up web part, I highly recommend getting familiar with it. Lightning Tools has versions for both on-premise and Office 365 environments.
For more information on The Lightning Conductor 2013 product, please click here.

As I was saying above, you can create a custom column and include any jscript and/or CSOM calls. Today, I ran in to a situation where we were aggregating content from a form library. As you may be aware, there isn’t a Title column present on the Form content type, so you need to include the Name field if you wish the file name displayed. The problem with this is the file name contains the .xml extension; and my client didn’t want that displayed.

This is where the Lightning Conductor 2013 custom field came in to play. I simply created a new custom field, named FormattedTitle, and included the following:

[FileLeafRef].Substring(0,[FileLeafRef].Length – 4)

Worked like a charm!

I’ll be writing more about this web part, especially how the jscript and CSOM custom column can be extended to related data in, etc.

If you are interested in purchasing the Lightning Conductor 2013 web part, please contact CollectiveKnowledge Solutions.

Redirect Users to a New Location Automatically

Recently, while working with a client, I noticed they had purchased a 3rd party web part to redirect users from one location to another.  There are other posts that describe a simple, out of box, solution; however, I wanted to include it here for my readers and clients.

There isn’t any need to write custom code or purchase a 3rd party product to redirect users from one location to another.

To accomplish this, use the following steps:

Let’s say, for example, you are in the process of migrating your SharePoint environment to a newer version.  As you perform the migration, you may wish to have a redirect on the old site sending the user to the new (migrated) site.

1 – On the site you wish to perform the redirect, add a Content Editor Web Part.

Add Content Editor Web Part

I’ve given the web part a title of “Redirect to New HR Site”.

2 – On the ribbon bar, in the Format Text tab, click the Edit Source button.  Then enter the redirect source.

RedirectUsers02

 

The actual redirect is the <meta …/> tag line, everything else is simply telling the user what will happen.  I feel it is always a good idea to inform the user of what is about to happen and ask them to update their bookmark.

The actual redirect is formatted as follows:

<meta http-equiv=”refresh” content=”{seconds};url={target URL}“/>

Replace {seconds} with the number of seconds to delay before redirecting the user.  10 seconds is a very common delay.

Replace {target URL} with the URL of where you with to redirect the user to.

Example, delay 10 seconds and redirect to HR site:

<meta http-equiv=”refresh” content=”10;url=https://cks.sharepoint.com/sites/contoso/departments/hr/”/>

 

 

 

Country Sausage and Gravy, Grits and Poached Eggs

I was in the mood for brunch today so I decided to make Country Sausage and Gravy, Grits and Poached Eggs.  It’s quick, simple and, oh so, delicious!

I absolutely love grits.  However, by themselves, they can be bland and boring.  The next time you make grits, consider spicing them up; the possibilities are endless.  When I make shrimp and grits, most often I will add sharp white cheddar cheese, havarti cheese, garlic, chipotle peppers in adobo sauce and onion.  This gives them a nice kick and really complements the shrimp.

For brunch today, I had already made up my mind that I wanted country sausage and gravy, so I decided to try something a bit different with the grits.  In this grits dish I added garlic, onion, chili powder and sharp pepper jack cheese.  They were delicious!

20140816 - Brunch

Get creative with those grits; there is so much you can do with them.  If you want to add a wonderful twist on texture, add hominy and/or whole kernel corn.

For the breakfast sausage, you can use any good quality “coarse ground” pork breakfast sausage, Jimmy Dean Breakfast Sausage, or your own blend.  I like making them in to patties and frying them.  This gives me a nice base for the sausage gravy.

If you would like to make fresh ground, homemade breakfast sausage, there are a lot of great recipes on the Internet.  I have made this one, from Alton Brown, and its fantastic.  Another nice twist is chorizo instead of breakfast sausage; however, if I want gravy, I think breakfast sausage is better!

And poached eggs, how can you go wrong?  If you’ve never tried or don’t know how to make poached eggs, check out this article.  They are super easy, fun to make and taste wonderful.

Keep cookin’ and let me hear about your successes!

SharePoint 2013 Management, Architecture and Design Course – Register Today

How many times have you been told the solution to your SharePoint 2013 needs require custom .NET development? Unfortunately, many consultants and consulting firms resort to custom .NET development because they are unfamiliar with how to truly architect solutions in SharePoint 2013. Granted, a certain amount of custom .NET development is required for most implementations; however, having a thorough understanding of how to architect your information to support business contextual needs, is the key to dramatically reducing those custom efforts and gaining more long-term value.

The truth is, most SharePoint Intranet, Document Management, Knowledge Management, Records Management and Collaboration solutions can be implemented with less than 10% custom development efforts. Implementing SharePoint 2013 using fundamental IA principals and techniques will reduce the need for custom development efforts, the cost of maintaining those efforts and the length of time you are tied to a consulting firm because of those efforts.

Start gaining the most value from Microsoft SharePoint 2013 today!

Join 5-year Microsoft SharePoint MVP, Bob Mixon, for a virtual hands-on 5-day, in-depth course and learn how to successfully apply Information Architecture techniques to SharePoint 2013. This course is geared to provide you with a thorough understand of Information Architecture and how to solve “real world” business problems on the SharePoint 2013 platform.

Register for our August 18, 2014 Class Today!

For complete course information and registration, see:

http://collectiveknowledgesolutions.com/sharepoint-2013-intranet-management-design-and-architecture-training/

We are now accepting Early Bird registration! Use the code CKS-SPMAD-2013-ID-JULY2014 before the end of July and receive a 10% discount!