Changing The Default Number Of Refiner Options In SharePoint 2013 Search

By default, SharePoint 2013 Search shows 5 options for each refiner, except result type, which has 6 options.

RefinerCount0

In order to change the number of options you need to edit the Filter_Default.html display template.  Do to this open Site settings, then Master pages and page layouts.  Drill through to  Display Templates -> Filters.  Download a copy of Filter_Default.html.

RefinerCount1Open Filter_Default.html in a text editor and find the two values below.

RefinerCount2

Change the values for shortListSize as required and save the file.  Upload the file to the document library where you downloaded the copy and overwrite the existing file.  Refresh the search page to see the change.

RefinerCount3

 

Hyper-V VM Stuck In Backing Up… State

In this post I’ll show how to resolve the issue of a VM that’s stuck in the “backing up…” state as shown by Hyper-V Manager, without having to reboot the virtual host.

BackingUp0

 

If a VM is stuck in the backing up… state it’s probably due to an error with the Microsoft Hyper-V VSS Writer.  Open an elevated command prompt and run “vssadmin list writers”.  The output should look like it does below, with no errors listed.

BackingUp1

 

The Microsoft Hyper-V VSS Writer runs within the Hyper-V Virtual Machine Management service, so in order to restart the VSS writer and clear the error, you have to restart the Hyper-V Virtual Machine Management service.  I’ve restarted this service without any issues, but please test this on a test server first.

BackingUp2

You can restart the service from the Services mmc, but if the Hyper-V VSS Writer is in an error state the service may hang on shutdown, in this case you’ll have to kill the vmms.exe process from Task Manager.

BackingUp3

When you do this VMs will disappear from Hyper-V Manager, but will reappear when you restart the Hyper-V Virtual Machine Management service.  Following the service restart the VM should no longer by in a backing up… state.

 

SharePoint 2013 Content Search Web Part: One or more of the following resource files failed to load

When adding the Content Search Web Part to a site for the first time, the web part took a while to load, then displayed the error:

One or more of the following resource files failed to load: /_catalogs/masterpage/display templates/language files/en-GB/customstrings.js?ctag=322$$15.0.4569.1000

CSWP0

To look for the missing file I went to Site Settings, then Master page and page layouts, which is under the heading Web Designer Galleries.  On that page I navigated through Display Templates -> Language Files.  I could see that for some reason the en-GB folder was missing.

CSWP1

The fact that the folder was missing was odd because I’d used the Content Search Web Part before within the Site Collection.  Anyway, to resolve the error I created the en-gb folder and copied customstrings.js from the en-us folder and pasted it into en-gb.

CSWP2

Switching Language In SharePoint 2013

In SharePoint 2010 it was easy to switch between languages using the user menu within SharePoint.  To switch language In SharePoint 2013 open Control Panel -> Language and click Add a language.

Language

Once you’ve added the required languages switch between them by moving the language you want to use to the top of the list.

Language2

Close and re-open your browser for the change to be recognised.

Language3

Re-Size The Distributed Cache Service In SharePoint 2013

When you install SharePoint Server 2013 the Distributed Cache service is configured to use 10% of the RAM on the server.  Half of the 10% is used for caching and the other half is used for memory management.  If you add RAM to the server you need to manually re-configure the Distributed Cache service to make use of the extra RAM.

To check the current RAM allocation run the command below from an elevated SharePoint 2013 Management Shell, replacing the server name as necessary.

Use-CacheCluster
Get-AFCacheHostConfiguration -ComputerName ServerName -CachePort “22233”

Distributed Cache Service 1

Calculate the new Distributed Cache service cache size for a 24 GB SharePoint Server as follows:

10% of 24 GB = 2.4 GB

Divide 2.4 GB by 2 = 1.2 GB

Convert 1.2 GB to MB = 1229 MB

Stop the Distributed Cache service on each host using Central Administration -> System Settings -> Manage services on server.

Run the command below from an elevated SharePoint 2013 Management Shell on one host at a time, replacing the cache size as necessary.

Update-SPDistributedCacheSize -CacheSizeInMB CacheSize

Start the Distributed Cache service on each host using Central Administration -> System Settings -> Manage services on server.

 

 

SCVMM 2012 R2 – Dynamic Optimization Cannot Be Performed At This Time

When trying to run the Optimize Hosts wizard within SCVMM 2012 R2 I received the error “Dynamic Optimization Cannot Be Performed At This Time” and “Object reference not set to an instance of an object”.

The Application Event Log on the SCVMM server contained a Windows Error Reporting event from the same time.  Opening the event showed a link to the error log.

SCVMMDO0

 

Opening the error log showed that the error was related to a logical network issue on the cluster.  This cluster has a converged network switch to which all virtual machines (VMs) connect.  However, two additional logical networks are mapped to the switch to enable the migration of VMs which were connected to logical networks of a different name on a legacy cluster.

SCVMMDO1

What I found is that some VMs were connected to the “Hyper-V External Access ” logical networks, rather than the ConvergedNetworkSwitch.  Changing the network mapping of the affected VMs to ConvergedNetworkSwitch enabled me to run the Dynamic Optimization wizard.

SCVMMDO2