Friday, March 27, 2015

Site Collection Administration permission lost - strange issue

Strange thing that happened to my account. I am Site Coll Admin on all web sites on an on prem server, but one day the "Site Collection Administrators" and "Site Collection Features" links were gone from two of the sites (in Swedish):





First thing I checked is in Central Administration and "Change Site Collection Administrators"
I was listed on all sites

Then I logged in as the farm administrator and could access the "Site Collection Administrator" link. One site was empty of accounts and the other had only one other account listed. Strange, since I have never changed these values.
I simply added back the accounts and on one of the sites it worked fine. But, on the other I got this message when I tried to add back my own account:

Parametern loginName får inte vara tom eller längre än 251 tecken
Translated:  The parameter loginName cannot be empty or bigger than 251 characters

Very strange, I have never seen this error before. But this made me remember that when I tried to add one of our AD groups, I got a message that the name was too long. So there is a limit on how long account or group names you can use in SharePoint. Somehow these entries must have been removed - in an update? Or when I ran the powershell command that clears the logon cache? I have no idea.

I tried a few times more, and then boom - the accounts just went through and now all three accounts were added.

I have no code running on the sites, the only customization is in my master page but no big at all. I have not made any changes in the web.config files on these two sites.

The only change I can think of is that the ASP.NET feature was installed by another administrator on the server, we will remove it again because it generates other errors in Event Viewer. Maybe something happened when that was installed.

Any ideas?




Change favicon in SharePoint 2013

This is a quick fix!
To change the icon that is displayed on the bookmark in a browser from the:

To something more sexy, then do the following:

Create a new folder in this location C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\IMAGES
I named mine "Custom". This is always best practice, so that your changes wont be overwritten in any update.
Paste your new favicon file, dont forget to rename the file extension to .ico

Open your html version of the master page (if you have a custom)
Change the location inside the tag 



Thursday, March 26, 2015

The Current server is running low on memory

This error is reported in Health Analyzer on my SharePoint 2013 server.
Image
 
So, the Distributed cache uses 10% of the  total physical memory on the server. The Distributed Cache service uses half of that memory allocation for data storage (also known as cache size), and the other half of that memory allocation is used for memory management overhead. When the cached data grows, the Distributed Cache service uses the entire 10 percent of the allocated memory.  (Source: technet)
To check the existing memory allocation, run this command
Use-CacheCluster
Get-AFCacheHostConfiguration -ComputerName ComputerName -CachePort "22233"
Which resulted in this
distc
 
There is 16 GB RAM on this server, so 819 MB is not enough. First stop the Distributed Cache Service in Services on server in CA
I first tried to update the size to what Technet recommended (7168 MB) but then I could not start the service again since I did not have enough free memory:

updisc
Instead, I updated the size to the double at 1600MB with this powershell cmd:
Update-SPDistributedCacheSize -CacheSizeInMB 1600
Then started the Distributed Cache service and the message in Health Analyzer disappeared.
 

SOLVED: "Open with explorer" disabled in IE11

[SOLUTION]
I found that this button was disabled because of this line in my Master Page - I am using Bootstrap theme from Codeplex and that comes with its own master page.
What I had to do was change this line in the header from:
 to (taken from Seattle master page)
And now, the button is enabled and working!
 
[PROBLEM]
I have an issue with Internet Explorer 11 and SharePoint 2013. The option "Open with explorer" is disabled, it works in IE10 but not IE11:

openexp

I have tried all possible solutions:
- added the site to Compatibility View settings
- added the site in Local intranet
- checked the add-ons
- checked that the local service WebClient was started
- I am running the 32-bit version
- the kb 2846960 is installed (http://support.microsoft.com/kb/2846960)
And obviously it is working in Internet Explorer 10. Maybe there is a new hotfix or something that needs to be installed, have googled this but not found any proper solution yet.

Tasks and Timeline disabled with bootstrap in IE11

This problem ONLY concerns IE11 and on a SharePoint site using the bootstrap theme. When you create a Team Site and add a Task list, the ribbon is disabled and either the Tasks nor the Timeline is visible. If you open the same site in IE10 or Chrome, it is visible and working.

The site is added into the Compatibility View Settings and if I apply the Default Theme then it all works so it must be something in the bootstrap CSS files or JS that is blocking.

taskstimeline

Display Comments and Likes in content search webpart

[SOLVED] Instead of relaying on the search crawler for the #Comments field, I simply added the following line in the Display Template and that works with continous crawling:
_#= ctx.CurrentItem.NumComments =#_
[/SOLVED]
 
I want to show both number of Likes and Comments in the News webpart, which I have built using Content Search and my own custom Display Template:

custmnew

The Likes is easy, it already exists. Just select “LikesCount” in the Property Mappings List (Note: I have added own lines in the display template, hence the extra rows below):

numlik

The number of comments are not included though, so that property needs to be created in the Search Schema. In SharePoint 2010 and in a Content Query Web Part, I referred to this field with #Comments. But that does not work in 2013.

Go to Search Application on CA, and to Search Schema. Add a new Managed Property, I called it just “NumComments” and map it to the column “ows_NumComments”. Configure it like this:

numcomconf

In the display template, I have used Glyphicons to display a Like button and a Comment button. This is my code for the “Like and comment” part of the news (I have removed the <> from code and replaced with [] ):

[div class="cbs-largePictureLineCustom ms-noWrap"]
[span title="_#= $htmlEncode(line4) =#_" id="_#= line4Id =#_"]_#= likesCount =#_  [/span]
[span class="glyphicon glyphicon-thumbs-up"][/span]
[span title="_#= $htmlEncode(line5) =#_" id="_#= line5Id =#_"]_#= line5 =#_ [/span span class="glyphicon glyphicon-comment"][/span]
[/div]

When running continuous crawling, the Likes showed up within a 3 minute interval (I have set that interval using Powershell cmdlet Get-SPEnterpriseSearchServiceApplication and continouscrawl), but the Comments never showed up unless I was doing a Full Crawl.
So to enable the number of comments in the continuous crawl, click on the “ows_NumComments” link that is displayed in the Search Schema:

sel_numcomconf

And deselect the “Include in full-text index” (this turns out to not help anyway which you will find out below):

desecl
But the Comments still did not show up in the web part, (unless I did a Full Crawl).
So I did a Reset Index. Ran a Full Crawl, to make sure that my changes above had been implemented. Still new comments are not displayed unless I run a Full Crawl.
Looked in the Search Schema again, but this time I clicked on Crawled Properties. Found a difference between the field ows_Comments and ows_LikesCount. The later had a mapping, which ows_Comments missed. So I added the following mapping into the "ows_NumComments":

crawledprops

Started a Full Crawl again to implement the changes.
Added a new comment and waited for the continuous crawl/incremental crawl to pick up the changes, but it does not show in the content search web part. Only when I do a full crawl. Don’t know if it has to do with the NumComments field being a Lookup field? If you look at the column properties on the blog site (the News are built on a blog site template) then this is all the info you get:

commentsfield

The column is not created as a Site Column, but a local in the Posts library of a blog site.  The only solution I could think of, and I don’t like it but what to do, is to create a new Content Source with only the link to the comments in it and set that to Full Crawl each 3 minutes. Don’t know if this will work in the long run, but for now it’s good enough:

contensource
 

Hide Conversations from Search

If you want to hide the “Conversations” options from the dropdown menu that is shown after the Search box, the easiest way is to CSS hide it. Set the following class to “display:none”.
#ctl00_PlaceHolderSearchArea_SmallSearchInputBox1_csr_NavDropdownList div:nth-child(3){display:none;}
Result:
drdwn

Then you want to remove the same option from the Search center page (results.aspx) also:

convhide

Edit the Search page (in the Search center)
Edit the Search Navigation web part
Click on “Search Settings Page”:

srsetpage

Select “Conversations” and “Delete”:

delconv

Done.