• 512-991-7197
  • This email address is being protected from spambots. You need JavaScript enabled to view it.
  • Always Open

Welcome to Microsoft SharePoint Tips & Tricks

Add Thumbnail field in multiple SharePoint sites

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

Recently I have seen on the community that when you add a column with the internal name of Thumbnail, SharePoint automatically generates a preview of the document. In the post below, we’ll add this column to multiple SharePoint sites that have the list or library that you intend to have the preview of the document. This feature has been requested on the SharePoint User Voice.

Replace the below $sites variable with your own sites and the $listName with the name of the document library or list that you intend to add the preview of the document. By default, this code will add to the default view a new column with the thumbnail.

$sites = @("https://contoso.sharepoint.com/sites/demo1",
$listName = "Documents" # NAME OF THE LIST

foreach($site in $sites){			   
	Write-Host "Apply Column to "$site -NoNewline
	Connect-PnPOnline -Url $site -UseWebLogin 
	Add-PnPField -List $listName -DisplayName "Thumbnail" -InternalName "Thumbnail" -Type Text -AddToDefaultView |Out-Null
	Write-Host "Done" 

It’s also possible to apply this preview of the Documents using the SharePoint Column formatting. You can find the instructions on how to apply this on via that feature in the below link:

  • https://www.c-sharpcorner.com/article/thumbnail-or-preview-of-files-in-sharepoint-document-library-using-column-format/

Long-time since the lastest time that you update of the PnP PowerShell or the SPO Management Shell? In the below link, you can find on how to update it. It’ll take no more than 2 minutes to have the latest resources.

  • http://sharepoint-tricks.com/install-update-uninstall-cmdlets-for-sharepoint-online/

Recommend other relevant articles:



© 2015 - 2020 Austin Laptop [AustinLaptop.Com]. All Rights Reserved.