SharePoint Online: Change List or Document Library Icon using PowerShell

Problem: Icon for document library is broken in SharePoint Online after migration.

How to Fix Broken Icon for SharePoint Online List or Document Library?
After migrating from SharePoint On-premises to SharePoint Online, we found certain document library icons are broken - These document libraries were provisioned through a custom application and has custom icons! As the related artifacts such as images and CSS were not migrated, list icons were broken (we can't deploy file system changes to the 16 hive in SharePoint Online!).
change document library icon in sharepoint online

But the good news is: We can change the document library icon using PowerShell!
#Set Parameters
$SiteURL = ""

#Connect to SharePoint Online site
Connect-PnPOnline -Url $SiteURL -UseWebLogin

#Get the List
$List = Get-PnPList "Documents"

#Update Icon for the list
$List.ImageUrl = "/_layouts/15/images/itdl.png"

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.