Friday, 20 June 2014

Set the refinable property to true for Managed Metadata Property in Search Service Application and do full crawl using PowerShell

Hi Again,

I came up with a requirement where I want to show the custom managed metadata property in the search refinement web part in the search results page.

By default the refinable property of any managed property is non set as false/not active. In order to show a property in the search refinement web part , it has to be active/true.

Below is the PowerShell script I wrote to update the custom managed metadata refinable property and then I did the full crawl.


Hope this is helpful.
Cheers,
Isha Jain  

Wednesday, 28 May 2014

SharePoint 2013 Exception from HRESULT : 0x80131904


Hi All,

I am recently involved in big migration project from SharePoint 2010 to SharePoint 2013. During this journey I come across a very weird exception - Exception from HRESULT : 0x80131904.
One of the site collections in the migrated web application is giving me this issue for all the users except site collection administrator. When any user other than site collection administrator tries to either change master page or page layouts under look and feel section in the site settings page. The user is getting the below error.



I have checked the permissions for the below lists and it all inherits from parent.
  • Master Page Gallery
  • Device Channel
Then I thought is it something related to windows to claims conversion , as I am getting the below error when I ran Test-SPContentDatabase.

"The web application is configured with claims authentication mode however the content database you are trying to attach is intended to be used against a windows classic authentication mode."

then I ran the below script to convert users from Windows to Claims to my content database, but still no luck.

Windows to Claims Conversion:


I have also tried deleting the master page gallery and importing from other working site collection but still the same error message.

ULS logs also giving me very weird errors like below:

Invalid column name 'tp_IsCurrent' - from the SQL executed for AllUserData table of the content database. When I read more about this column in the database I found the below description.

tp_IsCurrent: When a file is checked out, tp_IsCurrent is set to false on that file’s record, and a new line is created for the checked-out version of the file (wherein tp_IsCurrent becomes true).

I have almost lost my patience as I have spent more than a week to troubleshoot this issue. Then I found a light in the tunnel. I tried moving one of the items "BlankWebPartPage.aspx" from the master page gallery to a blanknew document library and have found that it also copies the below fields and content type in the document library when I copied the file.



Content Type: Page Layout

When I click on any of the above lookup fields, I got access denied for all the users except site collection administrators. Then I realised , it is something to do with the access with the above lookup fields.

Then I found, the nice blog explaining about the cache Profiles
http://sureshpydi.blogspot.com.au/2013/10/cache-profiles-in-sharepoint.html

and I found my solution to the problem, it is the Cache Profile list has unique permissions. I then just deleted the unique permissions from my cache profile list and everything started working :).


Hope this could save some of your time.

Cheers,
Isha Jain

 

Thursday, 17 April 2014

How to call and pass parameter from one PowerShell script file to another?

I came across a scenario where I have to call another PowerShell script file and pass the current PowerShell script file input parameter to this second file.

PowerShell as the name says is very powerful and I was able to achieve my requirement with a simple expression called as "Invoke-Expression" in PowerShell.

Just to explain you how I have achieved my above requirement, I have created two demo PowerShell files called First.ps1 and Second.ps1. I am gonna show you how I have called First.ps1 and invoke the Second.ps1and pass the First.ps1 input parameter to the Second.ps1 with "Invoke-Expression".



Hope this is helpful.
Cheers!!
Isha Jain

Monday, 31 March 2014

Upgrade Search Settings and result sources using PowerShell in SharePoint 2013

I came up with a requirement where I want the user to search the results only from the site collection level. In SharePoint 2010, we all know there are search scopes which help us to narrow down our search based on content sources, web address and metadata. However; there is no search scopes in SharePoint 2013. There is a new concept similar to Search Scope called as Search Result Sources.

This Result sources can be created at "Application Level", "Site Collection Level" and "Site Level".

You could find more information on Result Sources in SharePoint 2013 @ http://technet.microsoft.com/en-us/library/dn186229(v=office.15).aspx

I decided to script out the following
1. Creation of Enterprise Search Centre site
2. Update the search settings to point to this new search centre instead of default OSSSearchResults page.
3. Create a site collection level result source
4. Update the search results webpart properties to query only at above created site collection result source.

1. Create Enterprise Search Centre via PowerShell

Note: you need to activate the "BaseSite" Collection hidden feature before creating the search centre.
2. Settings the results page for your above search centre

3. Create a Site Collection level result source

4. Update the search results webpart to use this above result source for query.

Hope you like my approach.
enjoy!!
Isha Jain

Runtime error when creating SharePoint 2013 Pulishing site

Today, I received a very strange error when creating a sub publishing site in SharePoint 2013. I received the below error runtime error with the famous yellow screen.



I am surprised to see this error and I have full control to the site and uls logs says access denied to one of the mobile channel list. I wondered what is mobile channel list is, then after much searching I have found that there is a new feature introduced in SharePoint 2013 called device channels.

With Device channel in SharePoint 2013, you can render a single publishing site in multiple ways by using different designs that target different devices like Mobile, i-Pad etc.

In order to resolve this error, you need to grant at least read only access to all the users to this device channel list or break the unique permissions to this list. Device channel list is hidden and can be accessible via site settings -> Device Channels




Thus to solve the above error while creating the sub publishing site, at least provide read only permission to sub site owners at device channel list.

Hope this must have saved lot of your time.

Cheers,
Isha Jain