SharePoint 2016 – Changes in Filenames Support

With the release of SharePoint 2016, Microsoft is planning on removing some filenames restrictions that have been in the product for multiple versions. In this article, I will be comparing SharePoint 2013, which is blocking filenames based on these restrictions, and 2016 which works fine.

Special characters

As part of the SharePoint 2016 IT Preview, Microsoft has removed restrictions regarding filenames containing the following characters:

~

&

{ } *GUID

In SharePoint 2016:


Uploading a file with an invalid character in SharePoint 2016 will result in the following screen:

BadFileName2016

 

In SharePoint 2013:

Long Filenames

SharePoint 2016 now allows you to have filenames that are longer than 128 characters.

SharePoint 2016:

SharePoint 2013:

Getting Information About a Document’s Author in SharePoint

​Every now and then I stumble upon a hidden gem in SharePoint. This time around, it happened after I was asked to retrieve a list of all documents on a specific SharePoint site where a given user was the Author. There are no easy way, in SharePoint out-of-the-box to obtain information about who the author is for a given document stored in SharePoint. However, if you go and add a new column to a Document Library and name that column _Author using Single Line of Text as the data type, you can now expose information about the author of the documents that are contained in that library. New documents added to the library will now see their _Author property automatically filled up with information. Please note however, that documents that are already in the document library will need to have their properties updated in order for this value to show up.

Figure 1 below shows the scenario where the document library was created, the document Empty Learning Plan.docx was uploaded, and only then was the _Author field created, which is why its author value is empty. The second document, named CSS Priorities.docx was uploaded to the library after the _Author field had been added, and therefore has its value filled.

DocLibrary.png

Figure 1 – Two documents in a library, one showing the author of the document, the other has the author value empty
​If we wish to add the Author’s info to the second document, all we have to do is edit its properties. As soon as we hit the edit form of the document, we see that its _Author property is populated (see Figure 2 below).

zzPrepopulateAuthor.png

Figure 2 – Author property pre-poluated upon modifying items

Automating the Value’s Population

Alright, so most of you reading this blog post will be wanting to include this cool functionality to an existing library, and therefore can’t afford to have to go and edit the properties of every single document to get their _Author value. So what is the solution? Well you know me, so I went crazy and developped the following PowerShell script for you to run on your server to automate the field’s value population. Please note however, that this will update the last modified user and last modified date of all records in the list. The PowerShell script below will prompt you to specify the URL of the web site where the library is located as well as specify the name of the library for which you wish to update the _Author information. Note that if your library requires your documents to be checked out before being edited, that you will need to check them out first. Enjoy!

Add-PSSnapin Microsoft.SharePoint.PowerShell
$webUrl = Read-Host “Web URL”
$libraryName = Read-Host “Library Name”
$web = Get-SPWeb $webUrl
$list = $web.Lists[$libraryName]
foreach($item in $list.Items)
{
$item.Update()
}
$web.Dispose()​

Document Parser

​I had a colleague of mine come to me and ask me about a problem he had creating a new list based on a custom list template he created. He found some articles explaining what seemed the be a bug with SharePoint at first, which is preventing you from using custom list templates on Record Center sites. Basically, the custom list template was getting created properly, but the template never appeared in the create new list interface. On top of this, the Feature Id and Product Version fields were never being populated for the custom list templates created. See figure 1.

parserscreen1.jpg

Figure 1 – List Template catalog missing Product Version and Feature ID values

Another colleague of mine, stumbled upon an article that suggested a possible fix for this issue. The fix consisted in setting the ParserEnabled property to true on the actual web. Guess what? This works! But why is this property turned off by default on record center sites? For several reasons actually.

First let us take a look at what this parserenabled ​really does. SharePoint has an internal mechanism called the Document Parser that is responsible for keeping the metadata of actual documents in sync with the values associated with it in SharePoint. When you create a physical document on disk, there are some metadata properties associated with it. When you upload that same document to SharePoint, the application triggers a process that automatically synchronizes the fields of the SharePoint list item associated with your document with the ones from the document. When you disable this trigger by setting the ParserEnabled​ property to false on the site, your breaking any synchronization that exists between SharePoint and the local document. Why would anyone want to disable this feature you ask? Because in some scenarios, like in the case of a Record Center, you want to store a large amount of documents. Imagine what the performance impact would be on the farm if you were transferring ten million documents in SharePoint at once. Di​sabling the trigger improves performance in cases where you have large amount of documents. This is something to consider when designing your environments. One excellent option would be to create a custom event receiver and associated it only with the few libraries on your site that requires the parser to be enabled.