SharePoint 2013 Following sites not working

I found an interesting issue in one of my SharePoint 2013 environments related to following sites. When a regular user clicks on the “Follow” button displayed in the top right corner of the screen the user will get an error.


If you look into the ULS log you will find the following error:


SQL Database ‘Databasename’ on SQL Server instance ‘InstanceName’ not found. Additional error information from SQL Server is included below.  Cannot open database “Databasename” requested by the login. The login failed.  Login failed for user ‘Domain\Username’.

Interesting about this issue is, that the account which doesn’t have permission to open the database is the application pool identity of the portal webapplication in which the site lives which the user would like to follow.

The Mysites reside in a different webapplication then the site the user wants to follow.

After a little investigation I tried to set the “GrantAccessToProcessIdentity”  for the mysite webapplication for the applicationpool identity of the webapplication where the site the user want to follow resides in.

For that I used the below Powershell, which grants the account specified connect permissions on the database level. (This was also used in my previous blogposts “PowerPoint / Word WebApps–PowerPoint / Word WebApp cannot open this presentation / document” and “Excel calculation services–The Workbook can not be opened” to grant the proper permissions)

$webApp = Get-SPWebApplication “YourWebapp”


After running this I double-checked the permission of the database in SQL and found the permissions granted to the account as expected. When the user now tries to follow a site everything works as expected.


I don’t know if this is the proper way to solve this issue, I have encountered it only once due to the fact that it is still very early in the SP2013 implementation timeframe, I just wanted to share my experiences with this issue and will continue to keep my eyes open. If you experience the same problems please let me know.


SharePoint Conference 2012–Here we go

One more day to go and I will be sitting in a plane taking me to sunny Las Vegas Nevada where I will attend SPC12.

Im super excited to go, I have attended SPC11 and found it an amazing experience, taking that and adding a amazing new version of SharePoint I’m expecting one of the best weeks this year.

I already scheduled my sessions (too much choices if you ask me Smiley) and realized that I will have to sit and watch a lot of recordings once they are available which will keep me entertained even when the conference will be long over.

But the most important thing for me is being around awesome people – the SharePoint community is from my perspective one of the most outstanding communities out there and I’m pretty sure that we will have a blast.

If you want to meet up and talk some SharePoint (or other stuff) feel free to reach out to me, I’m more then happy to meet up with you.

“Database is up to date, but some sites are not completely upgraded” – and the journey to straighten things out

I faced an interesting thing in the SharePoint environments of one of my customers the other day…obviously the cool stuff never happens on your local environments Smiley.

This customer had patched their environment lately, everything was running smooth, nobody was complaining about anything, then, by incident, I checked the databasestatus.aspx page in central admin and found some databases marked with:

“Database is up to date, but some sites are not completely upgraded”.


So my first idea was, because they had a awful lot of databases in this state, to loop through all the databases and perform an upgrade-spcontentdatabase on the ones which contain not upgraded sites.

After running the script I found nothing changed on the UI (turns out if you do an IIS reset or an AppPool recycle this changes quite quickly). So after doing an IIS reset on the CA box I found some databases in the desired state “No action required” others though still in the same state.

So I checked the upgradestatus.aspx in the CA and found some warnings and errors for the databases containing sites which are not upgraded in the referenced upgrade logs. The most warnings I saw stated that

“Feature could not be upgraded. Exception: Unable to access web scoped feature (id: FeatureID) because it references a non-existent or broken web (id: webID) on site “siteurl”. Exception: System.ArgumentException: Value does not fall within the exptected range.”

When I checked the mentioned site and searched for the specific web I found this web existing in the recycle bin of the site.

So my next step was to create a PowerShell script to loop through all the sites and figure out which sites contain web objects in their recycle bin.

Once I have done that I created another PowerShell script removing all the webs from the recycle bin of the affected sites.

After that I ran my upgrade script again and found all databases in the “No action required” state except for two.

The first one was easy, this database was taken offline and for that couldn’t be upgraded.

For the second one I found Errors in the upgrade logs telling me:

Microsoft.SharePoint.Portal.Upgrade.MossSiteSequence failed.

Exception: Attempted to perform an unauthorized operation.                      

at Microsoft.SharePoint.SPSite.set_AllowDesigner(Boolean value)
   at Microsoft.SharePoint.Portal.Upgrade.AllowMasterPageEditingAction.Upgrade(SPSite site)
   at Microsoft.Office.Server.Upgrade.SiteAction.Upgrade()
   at Microsoft.SharePoint.Upgrade.SPActionSequence.Upgrade()

This confused me because I knew that my customer had SharePoint Designer disabled for this webapplication.

After some asking around it turned out this wasn’t always the case, they had it enabled for a short timeframe… So my assumption is one of their sitecollection administrators must have enabled SharePoint Designer on his or her site during that short timeframe and maybe even modified something with it… scary huh?

Now SharePoint Designer being disabled on webapplication level SharePoint seems to have a little problem with that when performing upgrade operations on this site.

To overcome this issue I enabled SharePoint Designer for the webapplication and rerun my upgrade script again and afterwards disabled the SharePoint Designer settings again on the webapp level. After that I had all databases in every SharePoint Admins favorite state “No action required”

One of a kind–Create a SharePoint 2013 Sitetemplate overview

If you are not living under a rock you might have noticed that SharePoint 2013 made its first appearance to the public a little while ago. I get asked a lot to demonstrate new features and the new sites or setup little playground environments where customers can play on.

To ease things up a little bit I have created a little powershell script which creates one site per site-template and also creates a html output where you can see the sites created and click the url.

All the sites get created in a dedicated content database which also gets created by the script.

Disclaimer: Of course you never… really never…did I say never ever??? just run scripts you find on the internet which you don’t understand… Don’t blame me for whatever happens. You are running these lines on your own risk.

Add-PSSnapin "Microsoft.sharepoint.powershell"

$templates = Get-SPWebTemplate
$url = "http://yourURL"
$siteadmin = "domain\user"
$contentdbname = "SharePoint2013_TemplateDemo"
$reportlocation = "c:/Templateoverview.html"

write-host -fore Green "Creating new Contentdatabase"
New-SPContentDatabase -Name $contentdbname -WebApplication $url 

foreach($template in $templates)
    $templateurl = $url +"/sites/"+ $template.title
    $templatename = $

    new-spsite -Url $templateurl -Template $templatename -OwnerAlias $siteadmin -ContentDatabase $contentdbname -ErrorVariable $err -ErrorAction SilentlyContinue 
    if ($err)
        write-host -fore red "An issue occured when creating site:" + $templateurl
         write-host -fore Green "A site based on template" $template.title "has been created successfully"
         out-file -FilePath $reportlocation -inputobject "<a href='$templateurl'>$templatename  $templateurl</a></br>" -Append


write-host "Find a clickable overview of all sites created by this script at:" + $reportlocation

Status list webpart continues to load…

Recently I was with a client and encountered some very interesting behaviour on one of their SharePoint 2010 sites.

Lets assume you have a list containing data and a status list which visualizes some of the data of the list in form of an graphical KPI, now you place a status list webpart on one of you pages displaying the information from your status list… everything works just fine. Unfortunately clients don’t call me in to show me how fine things are working…My client wanted to place a second (and even more) status list webparts on the same page and here is what they experienced:


The webpart which was placed last on the page will continue to show you the status bar instead of your beloved KPI.

After some investigation I found that my client was running on the December 2011 CU:


I reproduced this issue on my local environment after putting the February 2012 CU on the issue was fixed (I put February on on purpose to see how far back this issue has been fixed…)



SharePoint 2010 multi farm high availability consideration

With SharePoint 2010 the idea of a “farm of farms” got introduced by this an SharePoint 2010 deployment is described which not only consists of a single farm but of multiple farms sharing special service applications among each other.

A very common scenario is to have a “resource- or service farm” hosting the shareable services and multiple “consumer- farms” consuming the services from it.

As you might know, not all SharePoint2010 service applications can be shared across farms.

These are the service applications shareable across farms:

  • User Profile
  • Managed Metadata
  • Business Connectivity
  • Search
  • Secure Store
  • Webanalytics

Please refer to this TechNet Article for more details.

If you are looking for details on how to configure it this article can give you a good indication on how to do it.

So far so well known… I encountered an interesting thing with one of my clients who is running a mulit-farm environment and has several services shared across multiple farms.

During maintenance work they had to stop the SharePoint services on their “service farm” (that be the farm providing services for other farms) and when trying to access any webapplications hosted on the other farms they encountered an error message with a corelation id.

After checking the ULS logs I found:

Exception occured while connecting to WCF endpoint: System.ServiceModel.EndpointNotFoundException: Could not connect to https://servername:port/serviceapplicationGUID/ProfilePropertyService.svc. TCP error code 10061: No connection could be made because the target machine actively refused it <IP Adress>.  —> System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it <IP Adress>.      at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)     at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)     — End of inner exception stack trace —     at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)     at System.Net.HttpWebRequest.GetRequestStream()     at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput. GetOutputStream()     — End of inner exception stack trace —    Server stack trace:      at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput. GetOutputStream()     at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)     at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel. HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)     at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)     at System.ServiceModel.Channels.SecurityChannelFactory`1. SecurityRequestChannel.Request(Message message, TimeSpan timeout)     at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)    Exception rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)     at Microsoft.Office.Server.UserProfiles.IProfilePropertyService. GetProfileProperties()     at Microsoft.Office.Server.UserProfiles.ProfilePropertyServiceClient. <>c__DisplayClass1.<GetProfileProperties>b__0(IProfilePropertyService channel)     at Microsoft.Office.Server.UserProfiles.MossClientBase`1.ExecuteOnChannel(String operationName, CodeBlock codeBlock)


SharePoint Web Services Round Robin Service Load Balancer Event: EndpointFailure Process Name: w3wp Process ID: 6428 AppDomain Name: /LM/W3SVC/728495272/ROOT-1-129866768378254013 AppDomain ID: 2 Service Application Uri: urn:schemas-microsoft-com:sharepoint:service:82f426f16fb14278811f7cdce8c9912c#authority= urn:uuid:b217762e94f442b6b1c5d89a864f2a11&authority= https://servername:Port/Topology/topology.svc Active Endpoints: 1 Failed Endpoints:1 Affected Endpoint: https://servername:Port/serviceappGUID/ProfileService.svc  

Which tells me that when I try to access a site running on another farm (one which consumes the user profile service from the “services farm”) SharePoint tries to connect to the server this service runs on which is not accessible and for that gives you an error.

For me I draw the conclusion that it would be recommended to loadbalance the servers hosting your userprofile service application within your service farm to avoid that this server becomes the single point of failure.

“Upgrade required” and missing SQL aliases a funny little fact

I encountered an interesting issue today when I was scaling out a existing SharePoint 2010 farm. So after installing SharePoint, several language packs, service pack and CUs I successfully joined the server to the farm.

No issues so far.

When I was checking the “servers in farm” link within Central admin I found right next to my newly joined server a big red “Upgrade required” message. But it wasn’t highlighting what component it wants to have upgraded. Normally this component would also be highlighted in red.

So I double checked my installation and made sure that I had all components installed properly, I even ran the configuration wizard one more time. Still the same result.

So my next step was to force SharePoint to write me some upgradelogs and give me some more details on what it actually was missing.

For that I used the commandline psconfig:

psconfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures

Once it was done I checked Central admin for the upgrade status and found the upgrade failed as expected but now SharePoint wrote me some nice upgradelog which I could look into.

After checking the log I found a few errors telling me that SharePoint tries to upgrade databases located under a certain SQL alias but it could not find them.

So I fired up cliconfg and found the SQL alias not existing after adding it (and also adding it to the x64 version of cliconfg) I just re-ran the SharePoint configuration wizard and after checking the servers in the farm section in central admin tataaaaaa the server was added with a nice grey “no action required” right next to it.

And what is the key takeaway from this? If you use SQL aliases (which I am a pretty big fan of) make sure to have them configured consistent across all your servers and when you see a warning telling you that an “upgrade is required” don’t  immediately think that you have to install software but also check your configuration.