Remove a Authentication provider from a Web Application

Remove/Delete a Authentication provider from a Web Application…this can feel a bit tricky…not very intuative at all…

If you find yourself having more than one Authentication provider on your Web application, then you have(remember doing it or not) extended the Web Application and added a different Authentication provider for this particular extension. To remove it, remove the extension…

But…I cant even see my extended Web Application, you think…no, you cant, unless you do the following:

– In ‘Central Administration’ – ‘Manage Web Applications’, select your Web Application(default ‘SharePoint – 80’)
– Click on the Delete dropdown Arrow in the ribbon.

– Click ‘Remove SharePoint from IIS Web Site.’
– In the ‘Remove SharePoint from IIS Web Site.’ dialog select the extended Web Application in the drop down(example: SharePoint – 443)
– Delete IIS Web Site Yes/No, usually you would want to delete it as well, so click yes.
– Click Ok.
– Do an iisreset /noforce on all SharePoint Web Servers when done.





Twitter | Technet Profile | LinkedIn


Truesec SharePoint Security Health Check – Delivered in Sweden

Hi all.

Truesec SharePoint Security Health Check

This post is for the Swedish Community only…apologize the rest of you. (Short description in English below)

För de svenska läsarna, mitt härliga bolag Truesec har idag lanserat en tjänst som jag är riktigt stolt över. Vi kommer under hösten att hos kunder börja genomföra en Säkerhets hälsocheck speciellt framtagen för SharePoint miljöer. Läs gärna litet mer om tjänsten på länken nedan.

Truesec SharePoint Security Health Check

Tjänsten innebär en djupgående analys med fokus på säkerhet, vi kommer även att titta på lite best practises och performance parametrar med huvudfokus är att lyfta fram existerande brister och risker. Hör gärna av er via sidan om ni skulle vara intresserade.

Tjänsten är idag anpassad för SharePoint Server 2010 eller SharePoint Foundation 2010. Efter att SharePoint 2013 släppts på marknaden kommer vi även att stödja den.

(English: My outstanding Company, Truesec, announced today that we as of today are offering a brand new service: SharePoint Security Health Check. The service is described in the link above but unfortunately only in Swedish. In short, we will do a deep analyzes of the entire farm with all of its components and the result will be a report of any risks or vulnerabilities.
If you are a non-Swedish speaking customer and you are interested, add a comment to this page with contact information and I will get back to you with details in English, or just fill out the form on the Swedish link above)




Twitter | Technet Profile | LinkedIn

A guide to Branding and SharePoint Foundation part 2

A guide to Branding and SharePoint Foundation
Part 2

Part 1 | Part 2 |

This is the part two of the series trying to cover the tweaks needed to get a starter branding going on a SharePoint Foundation installation.

In part 1 I tried to explain why the most common method of using the $PUrl to get the relative path does not work and also how to customize the masterpage in order to insert a custom favicon without the use of $SPUrl. Now I will cover how to add a custom CSS to your master without the use of $SPUrl.

The most common method on a SharePoint server is to add this line:

<SharePoint:CssRegistration name=”<% $SPUrl:~sitecollection/Style Library/My Branding/MyStyles.css %>”After=”corev4.css” runat=”server” />

After the default CSS loader:

<SharePoint:CssLink runat=”server” Version=”4″/>

But since the use of $SPUrl is unavailable to us, we need to find something else. If we use a hardcoded path it will work as long as the master is deployed only in the site collection root, but if we want to use the same master in all subsites(spwebs) as well, then we need a way to get the relative path from the sitecollection root. In my SharePoint Branding Project Foundation adaptation I solved it like this:

<asp:literal runat=”server” Text=”&lt;link href='”/>
<SharePoint:ProjectProperty Property=”SiteUrl” runat=”server” />
<asp:literal runat=”server” Text=”/Style Library/My Branding/MyStyles.css’ rel=’stylesheet’ type=’text/css’/&gt;”/>

What the code does is that it builds a new href link that point to the custom css deployed to the site collection style library, same as the <SharePoint:CssRegistration would, it renders a link and loads the css. If we want the custom css to be applied after the default, then we also need to add these lines before the default css line.
The trick to this is the use of the webcontrol SharePoint:ProjectProperty that is available for use in Foundation as well as Server. This will give you the URL to the Site Collection root, for example:

Putting two literal contols before and after the webcontrol to fill in the text needed for a complete link tag is all that is needed.

This solution works very well for me, I hope that you will also find some help in my suggestion.

See also part 1, on how to add a custom favicon to your Foundation master

Stay tuned!



A guide to Branding and SharePoint Foundation part 1

A guide to Branding and SharePoint Foundation
Part 1

Part 1 | Part 2 |

SharePoint branding is something that most everyone wants to do, the default design is pretty good and stylish but it get dull and it does not fit in with any organizations brand book or design policy. A lot of posts have been written on the subject of SharePoint branding, many books have been published and most of what can be covered has been covered. What I found though during my work with the SharePoint Branding Project, is that there is a lack of information about branding and Foundation. Lots of organizations run Foundation, the reasons for doing so are many but the facts remains, SharePoint Foundation 2010 has a very large installed base. So, can’t we just buy the book on SharePoint branding and implement it in our Foundation farm? The answer to that question is most of the time no, or rather, not very likely. SharePoint Server has one vital component that Foundation lacks, it has a publishing infrastructure feature. In most cases the publishing components are used for some vital parts of a branding package, the most common one that you will see in almost every post is the

<% $SPUrl:~sitecollection/pathtosomething/%>

The SPUrl token is very handy when storing files in a centralized location in SharePoint, like for example the ‘sites/mycompany/style library/’. Lets use the FavIcon as an example in the first part.

<link rel=’shortcut icon’ href='<% $SPUrl:~sitecollection/Style Library/My Branding/Images/favicon.ico %>’/>

This tag would in Server farm pick the FavIcon image out from the site collection root. In Foundation you would see an error similar to this:

‘The expression prefix ‘SPUrl’ was not recognized. Please correct the prefix or register the prefix in the <expressionBuilders> section of configuration.’

Accessing CSS or Image files in the Style Library is easy using the $SPUrl expression builder to get the relative Site Collection Root URL(/sites/mycompany) or even the current Web Root URL. In Foundation the SPUrl token can’t be used so we need something else. One solution is pretty easy, just enter the relative path:

<link rel=’shortcut icon’ href=’sites/mycompany/style library/my branding/Images/favicon.ico’/>

For the Site Collection Root the path would resolve to:

http://webapplication/sites/mycompany/Style Library/My Branding/Images/favicon.ico

Perfectly allright, the favicon would be loaded. This is a great solution, with one huge flaw. If you have the branding implemented in all of your subsites then the path will be correct only in the root. Since the path is relative, it would in an example subsite look like this in the master:

<link rel=’shortcut icon’ href=’sites/MyCompany/Style Library/My Branding/Images/favicon.ico %>’/>

For my SubDivision subsite the path would resolve to:

http://webapplication/sites/mycompany/subdivision/Style Library/My Branding/Images/favicon.ico

Not ok! The load would fail since the favicon.ico is not located there. So, the permanent relative is only good for a site collection root with no subsites. You could obviously add the file to every subsite so that the path would work, but that is not really an option in most cases. So, how do we do it then…? In my own SharePoint branding project I use this workaround to replace the <link rel=’shortcut icon’ token:

<asp:literal runat=”server” Text=”&lt;link rel=’shortcut icon’ href='”/>
<SharePoint:ProjectProperty Property=”SiteUrl” runat=”server” />
<asp:literal runat=”server” Text=”/style library/my branding/images/favicon.ico’/&gt;”/>

It is a workaround, but it works. This will in reality build a relative path to the Site Collection Root even in the subsites and it will build up the <link> token by using 2 literal asp controls and the SharePoint:ProjectProperty control that is available in Foundation. The result in runtime will be the same as for a URL built on the $SPUrl expression builder.

<link rel=’shortcut icon’ href=’sites/mycompany/style library/my branding/Images/favicon.ico’/>

Add this to your Masterpage and you will have a functional FavIcon that uses a relative path.

Stay tuned!

Best regards

SharePoint Branding Project

SharePoint Branding Project


– Please review the project if you download and use it, use the above link! –

This template is used to create a new SharePoint branding solution wsp package, the package includes custom masterpage, stylesheet, logo and favicon. The wsp includes an activation and deactivation feature as well as a childweb eventreciever to apply branding on all subsites when created.

The SharePoint Branding Project is created by
Thomas Balkeståhl
Technical Specialist SharePoint
Enfo Zipper


Version 1.15 (NEW! Now also with minimal master and search styles. Added in 1.15 full support for SharePoint Foundation added)
Revision 1.0

This project is built for SharePoint Server 2010, SharePoint Foundation 2010 and Visual Studio 2010. It is a Site Collection Feature and activation will replace the master and the site logo, it will also add a favicon and a custom css.


1.1. Included is a minimal masterpage and basic Search classes. The minimal masterpage are used in a search center instead of the normal master. The MyBrandingMinimal.master will be deployed to the masterpage library and will be available to select in the site settings/Masterpage settings for a search site. Added to the MyStyles.css are also classes to support basic Search and Search Results styles. The included styling can easily be edited to suit your own needs. Deploy the solution as normal and then manually change the masterpage for the search site to the mybrandingminimal.master.

1.15 Now included support for Foundation. Because of the limitation in SharePoint Foundation that makes $SPUrl unavailable when getting a relative URL to the current sitecollection, code for foundation that replaces $SPUrl has been added. Instructions on how to configure this in included in the project inline and in the readme file. The SharePoint component affected are the custom CSS, the Favicon and the site logo. These can now be placed in the site collection root and still be accessable in the subsites that uses the same masterpage.

After installing the vsix template to your Visual Studio 2010, Start a new project, select a new SharePoint 2010 Branding project, give it a name and create the project. Then enter a URL to your SharePoint 2010 sitecollection in the Project Properties, under Site URL.

(remember, the template will only be installed to the user that executed the vsix file.)

Farm vs. Sandboxed
The project is by default configured as a sandboxed code, so If your farm is running in Sandboxed mode or if your site is an Office365 then you can deploy it as is. If your farm does not have the sandboxed code service running, then you need to configure this project to be deployed as a farm solution. This setting is available in the project properties. To deploy as a farm solution – Set the value ‘Sandboxed solution’ to False. (requires the user to have SharePoint administrator privileges to deploy the solution)

SharePoint Foundation 2010
The project support usage on SharePoint Foundation with slight modifications, the $SPUrl has to be replaced with a relative or absolute link, or a different approach that uses a similar method to the $SPUrl that is available on Foundation.
The reason for this is that the $SPUrl in a publishing function and as such it is only available on SharePoint Server 2010.
See Version 1.15 above.

To deploy the project to the designated site, Build menu – Deploy Solution (requires Visual Studio to run with elevated privileges, ‘Run as Administrator’).
To deploy in production, build the project in Build menu – Deploy Package. The wsp package will be located under <Your Projects folder>\ProjectName\ProjectName\Bin\Debug\ProjectName.wsp
Deploy the wsp to your farm using PowerShell(Requires Add-PSSnapin Microsoft.SharePoint.Powershell):

Add-SPSolution -LiteralPath <SolutionPath>
(Add-SPSolution -LiteralPath c:\solutions\ ProjectName.wsp)

Install-SPSolution -Identity <SolutionName> -WebApplication <URLname>
(Install-SPSolution -Identity ProjectName.wsp -WebApplication


Update-SPSolution -Identity ProjectName.wsp -LiteralPath c:\solutions\ProjectName.wsp -GACDeployment

A deployed solution will show as a Site Collection feature, this will have the same name as you r Visual Studio Project, activating it enabled all of the branding, deactivating it will replace the master with v4.master and remove the logo.

Modify the existing components to get the design and branding that is required. The components that can easily be edited and/or replaced are:

Master Page

Logo : The logo is in this version placed as a URL property in the ‘Title, Description, and Icon’ section of Site settings. This can be changed to have the logo in the masterpage, look up the SharePoint:SIteLogoImage> section in the master and follow the instructions inline. Remember to comment out the logo adding in the featureactivated section in the main.EventReceiver.cs

<SharePoint:SPLinkButton runat=”server” NavigateUrl=”/” id=”onetidProjectPropertyTitleGraphic”>
<SharePoint:SiteLogoImage name=”onetidHeadbnnr0″ id=”onetidHeadbnnr2″ style=”padding-left: 15px;padding-top: 10px;padding-bottom: 10px” LogoImageUrl=”<% $SPUrl:~sitecollection/Style Library/My Branding/Images/Logo.png %>” runat=”server”/></SharePoint:SPLinkButton>
(sample code for server, available in the readme file)
This will make the masterpage always show the logo, remember that the logo setting in site settings may override the masterpage SiteLogoImage. USing this method will also allow you to set a fixed link on the logo, so that it always points to the site collection root for instance.
(Code modification to the master needed to work on SharePoint Foundation)

Favicon : Replace the favicon.ico file in the ‘Style Library/My Branding/Images/ catalog. The ico file should be a real ico image and have a size of 32×32.
(Code modification to the master needed to work on SharePoint Foundation)

StyleSheet : Edit the styles in the included stylesheet MyStyles.css located in the ‘Style Library/My Branding/’ catalog. Or replace the file with your own using the same name. You can also add another CSS and refer to it in the master(se comments in master on how).
Add to this file the classes you need to style. (You can use F12 developer toolbar to find out which class to style.)
(Code modification to the master needed to work on SharePoint Foundation)

MasterPage : Edit the included master to suit your needs. The included master is a very lightly modified copy of the V4.master. Do not replace it or change its name, if you do, then you have to know what references in other places have to be changed as well.

The SharePoint Branding Project by BLKSTHL is licensed under a Attribution-NonCommercial-ShareAlike
3.0 Unported (CC BY-NC-SA 3.0) License

Description: Description: Creative Commons-licens

Site Settings by Powershell part 1 – Navigation

Configuring your site settings is really something that you want to do using PowerShell, this is for many reasons but the most obvious ones are that you get more control. You can test your script with settings in a test environment and see the effect, when it is perfected you simply run the script against a different URL and the result is moved to the proper target environment.
One more benefit is repeatability, you can do one configuration and repeat it for every site or web in your farm. Doing the same thing manually would take time and would increase the risk of making mistakes.
(See more Site settings by Powershell in my Whitepaper that can be downloaded from here: SharePoint 2010 Site Settings explained. I have tried to cover most every site setting and how it can be done using Powershell only. )

All of these settings can also be configured during site creation, in order to do that, get your publishingweb object of the websites you are creating, set the values and same as always, finish off with an update().

In this post I will try to cover most of the settings you can do in the Navigation part of your site settings. The Navigation settings are available only in sites in a site collection that has the SharePoint Server Publishing Infrastructure Site Collection Feature activated.

Activating this feature gives you among many other things, control over the global and current navigations. These settings are available in Site Settings under Look and Feel.

The settings that I will show how to configure using PowerShell are as shown in the below image. There are also ways to add and remove items from the navigations in the same dialog, but these will not be covered here.

First off, we need an object to work with. In this case we need a Publishing Web object, so first we create a spweb object, then a publishing web object:

$SPWeb = Get-SPSPWeb http://server/sitecoll/spweb/spweb
$SPPubWeb = [Microsoft.SharePoint.Publishing.PublishingWeb] 

Some changes, like unchecking the Show subsites, require that you first allow unsafe updates. You can set the show subsites to false, but it will never be reflected unless you first allow unsafe updates. This is done on the SPWeb object by:

$SPWeb.AllowUnsafeUpdates = $true

Using our Publishing Web object, we can now configure the different settings, from the top in the graphical user interface:

Global Navigation

Display the same navigation items as the parent site:

$SPPubWeb.Navigation.InheritGlobal = $true

Display the navigation items below the current site:

$SPPubWeb.Navigation.InheritGlobal = $false

Show subsites:

$SPPubWeb.Navigation.GlobalIncludeSubSites = $true

Show pages:

$SPPubWeb.Navigation.GlobalIncludePages = $true

Maximum number of dynamic items to show within this level of navigation:

$SPPubWeb.Navigation.GlobalDynamicChildLimit = 20 (int32)

Current Navigation

Display the same navigation items as the parent site: (both values in combination)

$SPPubWeb.Navigation.InheritCurrent = $true
$SPPubWeb.Navigation.ShowSiblings = $false

Display the current site, the navigation items below the current site, and the current site’s siblings: (both values in combination)

$SPPubWeb.Navigation.InheritCurrent = $false
$SPPubWeb.Navigation.ShowSiblings = $true

Display only the navigation items below the current site: (both values in combination)

$SPPubWeb.Navigation.InheritCurrent = $false
$SPPubWeb.Navigation.ShowSiblings = $false

Show subsites:

$SPPubWeb.Navigation.CurrentIncludeSubSites = $true

Show pages:

$SPPubWeb.Navigation.CurrentIncludePages = $true

Maximum number of dynamic items to show within this level of navigation:

$SPPubWeb.Navigation.CurrentDynamicChildLimit = 20 (int32)


Sort automatically:

$SPPubWeb.Navigation.OrderingMethod = "Automatic"

Sort manually:

$SPPubWeb.Navigation.OrderingMethod = "Manual"

Sort sites manually and pages automatically: (This is option is only available with publishing pages)

$SPPubWeb.Navigation.OrderingMethod = "ManualWithAutomaticPageSorting”

When Sort automatically is selected

Sort by Title (shown left):

$SPPubWeb.Navigation.AutomaticSortingMethod = "Title"

Sort by Created Date:

$SPPubWeb.Navigation.AutomaticSortingMethod = "CreatedDate"

Sort by Last Modified Date:

$SPPubWeb.Navigation.AutomaticSortingMethod = "LastModifiedDate"

Sort in ascending order (shown left):

$SPPubWeb.Navigation.SortAscending = $true

Sort in descending order:

$SPPubWeb.Navigation.SortAscending = $false


That’s it, that covers all of the settings I meant to show and this will hopefully be useful to you when scripting the creation and configuration of your sites.
In order to help you get started, you can modify the script included below and that will allow you to configure all of the above settings the same way on all sites in a designated site collection.

Sample script

# get a sitecollection object(SPSite)
$SPSite = Get-SPSite -Identity ““
# loop through all the subwebs(SPWebs) in the site collection
foreach ($SPWeb in $SPSite.AllWebs)
  # check so that this is not the root web
  if (!$SPWeb.IsRootWeb)

 # Save AllowUnsafeUpdates setting and set it to allow.
    $AllowUnsafeUpdatesStatus = SPWeb.AllowUnsafeUpdates
 SPWeb.AllowUnsafeUpdates = $true
 # Get a PublishingWeb object for the current web
    $SPPubWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]

    # UnComment the setting you will use:
    # Global settings
    # $SPPubWeb.Navigation.InheritGlobal = $true
    # $SPPubWeb.Navigation.InheritGlobal = $false
    # $SPPubWeb.Navigation.GlobalIncludeSubSites = $true
    # $SPPubWeb.Navigation.GlobalIncludeSubSites = $false
    # $SPPubWeb.Navigation.GlobalIncludePages = $true
    # $SPPubWeb.Navigation.GlobalIncludePages = $false
    # $SPPubWeb.Navigation.GlobalDynamicChildLimit = 20
    # Current settings
    # See combination of the two below
    # $SPPubWeb.Navigation.InheritCurrent = $true
    # $SPPubWeb.Navigation.ShowSiblings = $false
    # $SPPubWeb.Navigation.CurrentIncludeSubSites = $true
    # $SPPubWeb.Navigation.CurrentIncludePages = $true
    # $SPPubWeb.Navigation.CurrentDynamicChildLimit = 20
    # Sorting
    # $SPPubWeb.Navigation.OrderingMethod = "Automatic"
    # $SPPubWeb.Navigation.OrderingMethod = "Manual"
    # $SPPubWeb.Navigation.OrderingMethod = "ManualWithAutomaticPageSorting”
    # $SPPubWeb.Navigation.AutomaticSortingMethod = "Title"
    # $SPPubWeb.Navigation.AutomaticSortingMethod = "CreatedDate"
    # $SPPubWeb.Navigation.AutomaticSortingMethod = "LastModifiedDate"
    # $SPPubWeb.Navigation.SortAscending = $true
    # $SPPubWeb.Navigation.SortAscending = $false
  # cleanup 
 # Set AllowUnsafeUpdates back to original value
 $SPWeb.AllowUnsafeUpdates = $AllowUnsafeUpdatesStatus
  $SPWeb.Dispose() }
# cleanup

Please allow some time for the changes to take affect, it can take a couple of minutes until the changes are reflected in your navgation.


PortalNavigation Members

2012-02-16 Updates: Added $SPWeb.AllowUnsafeUpdates section to script.