Identifying your SQL server version using SQL Server Management Studio

This one’s quick. There are a couple of ways to find out your SQL server version. Firstly the version is listed within the Object Explorer in the Microsoft SQL Server Management Studio. The second option which provides more detailed information is to run the following query.

select @@version

The version information is returned in the query results section at the bottom. Both examples of obtaining the SQL server version are shown in the image below.

Identifying Microsoft SQL Server version using Microsoft SQL Server Management Studio
Identifying Microsoft SQL Server version using Microsoft SQL Server Management Studio

Security trimmed top navigation links

I was asked to review a client environment yesterday to find out why the links in their top navigation bar were displaying for users that did not have permission to the particular sites.

Creating sites

It turns out that when sites were being created by the client on SharePoint Foundation 2010 they were being created without the ‘include on the top navigation bar’ check box ticked. As a result, the link was then not automatically added to the top navigation bar but instead later manually added and so was not security trimmed link.

Display this site on the top link bar of the parent site
Display this site on the top link bar of the parent site

It was then after removing permissions to the various sites that it became clear that users were able to see the top navigation bar link to the sites even though they did not have access.

Obviously, there are situations when users don’t have permissions to a site and you don’t want them to see that the site even exists. An example of this might be in an extranet scenario when you have third parties accessing project sites and you don’t want those third parties seeing the names of other project sites that may exist let alone the content…so how do we prevent this?

Identifying security trimmed links

By reviewing the URLs of the links in the top navigation bar I was able to identify whether the links were security trimmed or not. If the field for the URL is disabled then the link is security trimmed and most probably created when as the site was created.

Custom top navigation link that is not security trimmed
Custom top navigation link that is not security trimmed
Security trimmed top navigation link
Security trimmed top navigation link

Adding new security trimmed links

After identifying the problem, I then had to make the existing links security trimmed. I did this in two stages. The first was to make a note of the position of the link that needed to be replaced. I then deleted it from the top navigation bar using the ‘Top Link Bar’ site settings page (_layouts/topnav.aspx). The second stage was then to create the new security trimmed link by using the PowerShell code below.

Modify the $SPWeb and @(“Site Name”, “/sitename/default.aspx”) arguments as required and run the code for each of the top navigation bar links that need to be security trimmed. Remember the old link will need to be removed and the new one ordered as required.

Conclusion

It appears SharePoint, specifically SharePoint Foundation 2010 only honours security trimmed links in the top navigation when the links are created automatically as opposed to being created manually.

Note: this post specifically targets SharePoint 2010 Foundation which does not include the extended navigation that is included as part of the Publishing feature.

Mums delicious brownie recipe aka SharePoint Brownies

I have baked these delicious chocolate brownies countless times using an old recipe my mum shared with me many years ago. I’ve even enjoyed them with many a friend, colleagues & customers alike. I often bake these delicious brownies for customers when I’m delivering SharePoint and Microsoft 365 workshops or deployments, hence they have since become known as SharePoint Brownies or Microsoft 365 Brownies or simply the mum’s delicious brownies! Many have asked for me to share the recipe, so here it is…

Delicious Brownie Recipe

Ultimately delicious chocolate brownies
Ultimately delicious chocolate brownies #SharePointBrownies

Ingredients

  • 140g unsalted butter softened and a small amount for lining the baking tin
  • 200g quality plain chocolate such as Lindt or Hotel Chocolat
  • 200g caster sugar
  • Pinch of sea salt
  • 2 tsp vanilla extract / vanilla paste
  • 2 eggs and 1 egg yolk
  • 85g plain flour

Method

  1. Preheat oven to 180°c
  2. Line a brownie tin with a small amount of butter (7″ square tin is most suitable)
  3. Melt the butter and chocolate on a slow heat and then allow to cool slightly
  4. Mix in the sugar, a pinch of sea salt and the vanilla stopping once the mixture is a little grainy
  5. Whisk in the eggs and yolk one at a time, stirring each time until blended
  6. Add the flour and beat for a minute or so until thickened and smooth
  7. Pour the mixture into tin and bake for 40-45 minutes until a cocktail stick comes out with moist crumbs
  8. Allow to cool and cut into small rectangles slices

I hope you enjoy these delicious brownies (#SharePointBrownies #Microsoft365Brownies).

ZoomIt for Mac – another screen magnifying utility

On many occasion, I have been to conferences and on training where the presenter has done a demonstration and used a screen magnifying utility to enlarge part of the display. There are many utilities available that provide this functionality and are typically included with the accessibility option of most operating systems.

Zoom It working
Zoom It working

Having asked many a presenter what they were used to magnify the screen, most pointed in the direction the Sysinternals utility ZoomIt which I have since used. More increasingly I am presenting and doing demonstrations on my Mac which leaves without such as useful utility.

After a short time reviewing various Apps available, I decided on Zoom It for Mac for a small price of £0.69 in the Mac App store. It sits nicely in the toolbar and allows you to customise the loupe size, zoom and shape through various key shortcuts or from the toolbar menu.

Zoom It toolbar menu
Zoom It toolbar menu
Zoom It Settings
Zoom It Settings

Enhance your demonstrations and use a utility like either of the magnifying utilities I’ve mentioned – I sure am!

Hiding an empty rich text column in XSLT

This morning I was trying to create a new style in the itemstyle.xsl stylesheet to use within the content query web part (CQWP). I needed a custom style to display a list of announcements, some of which had content and others didn’t and this style was to improve this output.

The problem is that the ‘Body’ column of an announcement or more importantly the ‘rich text’ field type is never really empty. Even when the column genuinely empty and has no rich text content, a hidden HTML element (a div) exists and acts as a wrapper for any content. As a result, if you try and use a typical ‘if equals null’ statement to hide the rich text column it won’t work because of this hidden element.

Examples

An empty rich text column on SharePoint 2010 always has 37 characters as shown below.

Empty rich text column in SharePoint 2010
Empty rich text column in SharePoint 2010

With SharePoint 2007 the rich text column has 65 characters when empty, again as shown below.

Empty rich text column in SharePoint 2007
Empty rich text column in SharePoint 2007

Solution

The solution, in the end, was to use the string-length function to determine if the rich text column was longer than the standard 37 characters on SharePoint 2010 as identified above.