Shared Properties Not Available for Selection in Document Set Content Type

May 15, 2015

We are using Document Set-based content types to manage documents in our SharePoint 2013 collaboration environment. Document Sets include the ability to use Shared Properties. Shared Properties allow you to pre-set values that will be pushed down to any document within the Document Set, and are great for discovery and automatic settings.

One of our Document Set-based content types wasn’t letting us select all of our site columns as Shared Columns. Even though the Site Columns were added to the content type, they didn’t all appear. Of the 8 site columns added to the content type, only 3 were available for selection as Shared Columns. You can view Shared Columns within any content type based on a Document Set by selecting the Document Set settings link in the Content Type edit screen.

The issue was identified after some Internet sleuthing on the problem. Some of our site columns were set to not display in the Edit form, and this is a requirement to be selectable as a Shared Property.

Background information is here:

http://sharepoint.stackexchange.com/questions/70156/sharepoint-2010-document-set-shared-column-settings-arent-displaying-all-colum

The site column property for us was ShowInEditForm=FALSE. Changing this site column property allowed us to select it as a Shared Property. The following PowerShell commands allow you to set this field.

$web = Get-SpWeb http://my-web-url
$web.Fields["InternalFieldName"].ShowInEditForm = $true
$web.Fields["InternalFieldName"].Update()

After setting this property the field showed up in the Shared Columns list immediately.

Advertisements

Page File impacts on SharePoint 2013

April 29, 2015

We were getting very high numbers of errors on our SharePoint 2013 crawl servers, in the 10,000s in some cases. After contacting Microsoft they advised that our page files weren’t big enough. We had 4GB allocated in static mode, but then changed it to Auto mode. The general rule of thumb is 1.5x RAM

This fixed our search problem.

Reference: http://blogs.msdn.com/b/chaun/archive/2014/07/09/recommendations-for-page-files-on-sharepoint-servers.aspx

HOWTO Get the Search Service Topology Status and Search Health Detail

April 16, 2015

I found this fabulous PowerShell script on GitHub:

https://github.com/chrisdee/Scripts/blob/master/PowerShell/Working/SharePoint/SharePoint2013/SP2013GetSPSearchServiceTopologyState.ps1

It gives a far more detailed status of Search health and will hopefully mean less index resets for me in the future!

HOWTO Check the SharePoint 2013 Crawl Status using SQL Server

April 13, 2015

The Content Sources page in SharePoint 2013 Search Service app displays the current status of crawls on your farm. A lot of my crawls were stuck in the Starting or Completing state and were never marked off as being finished, even after running for over 48 hours on small data sets. I used the following script to find out the exact state of the search components:

SELECT [CrawlID]
 ,[CrawlType]
 ,[ContentSourceID]
 ,[Status]
 ,[SubStatus]
 ,CASE
 WHEN (Status=0 and SubStatus=0) THEN 'New crawl, requesting start'
 WHEN (Status=1 and SubStatus=1) THEN 'Starting, Add Start Address(es)'
 WHEN (Status=1 and SubStatus=2) THEN 'Starting, waiting on Crawl Component(s)'
 WHEN (Status=4 and SubStatus=1) THEN 'Crawling'
 WHEN (Status=4 and SubStatus=2) THEN 'Crawling, Unvisited to Queue'
 WHEN (Status=4 and SubStatus=3) THEN 'Crawling, Delete Unvisited'
 WHEN (Status=4 and SubStatus=4) THEN 'Crawling, Wait for All Databases'
 WHEN (Status=5 and SubStatus=0) THEN 'Failed to Start (eg Another Crawl Already Running)'
 WHEN (Status=7) THEN 'Resuming'
 WHEN (Status=8 and SubStatus=1) THEN 'Pausing, Waiting on crawl component(s) to pause'
 WHEN (Status=8 and SubStatus=2) THEN 'Pausing, complete pause'
 WHEN (Status=9) THEN 'Paused'
 WHEN (Status=11 and SubStatus=0) THEN 'Completed'
 WHEN (Status=12) THEN 'Stopped'
 WHEN (Status=13 and SubStatus=1) THEN 'Stopped, waiting on crawl component(s) to stop'
 WHEN (Status=13 and SubStatus=2) THEN 'Stopping, complete stop'
 WHEN (Status=14 and SubStatus=1) THEN 'Completing, waiting on crawl component(s) to complete'
 WHEN (Status=14 and SubStatus=2) THEN 'Completing'
 WHEN (Status=14 and SubStatus=4) THEN 'Completing, get deletes pending'
 END AS [StatusAsText]
 ,[Request]
 ,[RequestTime]
 ,[StartTime]
 ,[EndTime]
 ,[DeleteUnvisitedStart]
 ,[IsCompleting]
 ,[StartAddressList]
 FROM [MSSCrawlHistory]
ORDER BY StartTime DESC

I was getting “…waiting on crawl” messages against my content sources. One of my crawl servers had the search service hung. Restarting the search service on that server finished off the crawl and reported Completed straight away. Much better!

 

HOWTO Remove the Lock on a SharePoint File

April 10, 2015

A user on one of our SharePoint sites had a file in an Exclusive lock on their laptop, and couldn’t remove the lock. After checking a few sites for how to unlock:

http://sharepoint.stackexchange.com/questions/122067/release-client-side-lock-by-javascript

I cobbled together this PowerShell function based on that. By default it displays the lock status of a file, and if you use the $unlock parameter it will also unlock the file.

Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
function SPUnlockFile()
 {
 param(
 [Parameter(Mandatory=$True)][string] $webUrl
 ,[Parameter(Mandatory=$True)][string] $fileUrl
 ,[Parameter()][bool] $unlock = $false
 )
#Get Web and File Objects
 $web = Get-SPWeb $WebURL
 $File = $web.GetFile($FileURL)
#Check if File is Checked-out
 if ($File.CheckOutType -ne "None")
 {
 Write-host "File is Checked Out to user: " $File.CheckedOutByUser.LoginName
 Write-host "Checked Out Type: " $File.CheckOutType
 Write-host "Checked Out On: " $File.CheckedOutDate
#To Release from Checkout, Ask the checked out user to Checkin
 #$File.Checkin("Checked in by Administrator")
 #Write-host "File has been Checked-In"
 }
#Check if File is locked
 if ($File.LockId -ne $null)
 {
 Write-host "File is Locked by:" $File.LockedByUser.LoginName
 Write-host "File Lock Type: "$file.LockType
 Write-host "File Locked On: "$file.LockedDate
 Write-host "File Lock Expires on: "$file.LockExpires
 Write-host "File Lock Id: "$file.LockId
if ($unlock)
 {
 Write-Host "Releasing lock..."
 $userId = $file.LockedByUser.ID
 $user = $web.AllUsers.GetByID($userId)
$impSite= New-Object Microsoft.SharePoint.SPSite($web.Url, $user.UserToken); $impWeb = $impSite.OpenWeb(); $impFile = $impweb.GetFile($FileURL)
 $impFile.ReleaseLock($impFile.LockId)
}
 }
 else
 {
 Write-Host "File is unlocked" -foregroundcolor Green
 }
}
#USAGE
 #SPUnlockFile -weburl "http://weburl" -fileUrl "http://fullpathtofileurl"
 -unlock $false

HOWTO Change a SharePoint 2013 Host-Named Site Collection HNSC to a Path-Based Site Collection

January 29, 2015

I came up with this issue in our DEV SharePoint 2013 environment. I had created a host-named site collection using the powershell command:

New-SPSite -URL http://hostnamedsitecollection -WebApplication http://webappname

but I wanted to move it to it’s own host-header web application instead. Advice on the Internet is to backup-restore the content via Backup-SPWeb or other similar mechanisms such as import-export. However the site collection was pretty big and it would have taken a while.

STANDARD WARNING: The following steps involve direct editing of a SharePoint 2013 Content Database and is not supported by Microsoft etc etc end of the world etc etc

In SQL Server on the content database, the command:

SELECT Id, HostHeader
FROM dbo.AllSites

displays the host header url set against the site collection. Editing this value and setting it to NULL clears the host header setting. The process I used was as follows:

1. Remove the content database from the host-header Web Application #1
2. Change the HostHeader field to NULL in the content database
3. Re-attach the content database to the host-named Web Application #2

SharePoint should re-attach your content database, check the dbo.AllSites table, and add your site collection to the website using normal path-based site collection.

Yes, it’s a hack!

HTH

SharePoint 2013 Remote Blob Storage Stops Working after December 2014 Cumulative Update

January 12, 2015

I upgraded a test environment over the weekend that had the SQL Server 2012 Remote Blob Storage provider configured and working. After the upgrade I got errors accessing Remote Blob Storage files, with a “Permission Denied” SQL error appearing in the ULS logs.

The Web Application account in use by SharePoint was a member of the DBO role to enable Remote Blob Storage to work properly. After the Cumulative Update was applied, this permission was gone. I added the permission back via SQL Management Studio, and Remote Blob Storage worked again. CU quirk perhaps?

HOWTO Configure Shredded Storage in SharePoint 2013 using FileWriteChunkSize

January 8, 2015

We have installed Remote Blob Storage and wanted to ensure it was used by modifying the FileWriteChunkSize for Shredded Storage. The configuration is performed against the Web Application that your Remote Blob Storage-enabled database is attached to. The following commands will configure Shredded Storage FileWriteChunkSize for 4MB files:

$webapp = Get-SPWebApplication http://yourwebappurl
$webapp.WebService.FileWriteChunkSize = 4194304
$webapp.webservice.Update()

More information is on TechNet here:
http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.administration.spwebservice_properties(v=office.15).aspx

UPDATE: Thanks to Mario Alvares for pointing out a Bill Baer presentation on appropriate settings for FileWriteChunkSize.

Fixing SharePoint 2013 Unexpected SPAudienceValidator Audience URI is not valid for context

November 28, 2014

We had created a site collection on a web application with the wrong URL and needed to change it. An accepted method is to remove SharePoint from IIS and re-add via:

Update a web application URL and IIS bindings for SharePoint 2013

However after bringing the new site back online I got site errors when visiting:

Cannot find site lookup info for request Uri http://%5Bsite%5D

Unexpected SPAudienceValidator: Audience Uri http://%5Bsite%5D is not valid for the context.

I tried to do an IISReset but that didn’t resolve the issue. Looks like a caching problem, so instead I restarted services as follows:

  1. IIS Admin Service
  2. SharePoint Administration
  3. SharePoint Timer Service
  4. World Wide Web Publishing Service

After IIS returned to service and SharePoint had reloaded, the issues disappeared.

 

 

 

Setting SSRS Column Headings for CSV Output

October 8, 2014

Got stuck on this today and found this post:
http://www.sqlchick.com/entries/2011/8/12/updating-the-ssrs-name-property-to-control-csv-column-headin.html
Not sure why, but I had to edit the textbox properties of the detail row text box, not the text box in the header row. Works now though!