Fixed - Missing Site Assets Library in SharePoint Online – communication site

[Fixed]: Missing Site Assets Library in SharePoint Online

One comment

Loading

A missing Site Assets Library in SharePoint Online – in SharePoint online communication site, many times we might notice that the asset library list template is missing while we try to add an app from a site content menu – this issue was not there earlier, Microsoft had set this limitation from 2019 onwards. In this article, we will learn how to fix the missing site assets library in SharePoint Online site so that we can add the site assets library from the site content menu.

For example, below is my communication site where if we go to add an app from the site content menu, we don’t see the “Site Assets” library, and when we search the “Site Assets” library we will see the below error message – “We didn’t find a match here, but check out the hundreds of results in the SharePoint Store. We didn’t find a match here but search across all your apps.”

Site Assets library is missing in SharePoint Online communication site
Site Assets library is missing in the SharePoint Online communication site

How to fix the site assets library missing in the SharePoint Online communication site?

In multiple ways, we can fix this issue.

Approach 1: Missing Site Assets Library in SharePoint Online

Activate the “Video and rich media” site collection level feature.

Activate Video and Rich Media site collection feature in SharePoint Online communication site
Activate Video and Rich Media site collection feature in SharePoint Online communication site

Now, if we go to add the “Site Assets” library we can add it.

Site Assets library in SharePoint Online communication site
Site Assets library in SharePoint Online communication site

Video and rich media provides libraries, content types, and web parts for storing, managing, and viewing rich media assets, like images, sound clips, and videos.

 

Approach 2: Missing Site Assets Library in SharePoint Online

Activate the “SharePoint Server Publishing Infrastructure” site collection level feature and “SharePoint Server Publishing” web scope feature.

The “SharePoint Server Publishing Infrastructure” feature provides centralized libraries, content types, master pages, and page layouts and enables page scheduling and other publishing functionality for a site collection.

The “SharePoint Server Publishing” feature creates a Web page library as well as supporting libraries to create and publish pages based on page layouts.

Approach 3: Missing Site Assets Library in SharePoint Online

Using the below PnP PowerShell script, we can enable the site assets library on the particular site.


####The below script is used to enable the site assets library in SharePoint Online communication site.

cls

$PSshell = Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorVariable err -ErrorAction SilentlyContinue
if($PSshell -eq $null)
{
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}

$fileName = "Enable_SiteAssetsLibrary_using_PnP_PowerShell"

#'yyyyMMddhhmm yyyyMMdd
$enddate = (Get-Date).tostring("yyyyMMddhhmmss")
#$filename = $enddate + '_VMReport.doc'
$logFileName = $fileName +"_"+ $enddate+"_Log.txt"
$invocation = (Get-Variable MyInvocation).Value
$directoryPath = Split-Path $invocation.MyCommand.Path

$directoryPathForLog=$directoryPath+"\"+"LogFiles"
if(!(Test-Path -path $directoryPathForLog))
{
New-Item -ItemType directory -Path $directoryPathForLog
#Write-Host "Please Provide Proper Log Path" -ForegroundColor Red
}
#$logPath = $directoryPath + "\" + $logFileName

$logPath = $directoryPathForLog + "\" + $logFileName

$isLogFileCreated = $False

function Write-Log([string]$logMsg)
{
if(!$isLogFileCreated){
Write-Host "Creating Log File..."
if(!(Test-Path -path $directoryPath))
{
Write-Host "Please Provide Proper Log Path" -ForegroundColor Red
}
else
{
$script:isLogFileCreated = $True
Write-Host "Log File ($logFileName) Created..."
[string]$logMessage = [System.String]::Format("[$(Get-Date)] - {0}", $logMsg)
Add-Content -Path $logPath -Value $logMessage
}
}
else
{
[string]$logMessage = [System.String]::Format("[$(Get-Date)] - {0}", $logMsg)
Add-Content -Path $logPath -Value $logMessage
}
}

#Paramaters area
#$adminSiteURL="https://globalsharepoint2020-admin.sharepoint.com"
$SiteURL="https://globalsharepoint2020.sharepoint.com/"
$userName = "YourSPOAccount@YourTenantDomain.com"
$passWord = "YourSPOPassword"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
#Paramaters area - Ends

try
{
#Connect-PnPOnline -Url $SiteURL -Credentials $cred

$targetConnection=Connect-PnPOnline -Url $SiteURL -Credentials $cred -ReturnConnection

#Connecting web2 with connection
#$targetConnection = Connect-PnPOnline -Url $SiteURL -Credentials $cred -ReturnConnection

#$targetConnection = Connect-PnPOnline -Url $SiteURL -CurrentCredentials $cred -ReturnConnection
$targetWeb = Get-PnPWeb -Connection $targetConnection
$targetWeb.lists.EnsureSiteAssetsLibrary()

}
catch
{

$ErrorMessage = $_.Exception.Message +"in enabling site assets library in communiction site!:"
Write-Host $ErrorMessage -BackgroundColor Red
Write-Log $ErrorMessage

}

While executing the above script we might get the below error, for that, we need to verify that we have successfully connected to the site.

format-default : The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.
+ CategoryInfo : NotSpecified: (:) [format-default], CollectionNotInitializedException
+ FullyQualifiedErrorId : Microsoft.SharePoint.Client.CollectionNotInitializedException,Microsoft.PowerShell.Commands.FormatDefaultCommand

Summary: What we had learned here (Picture library in SharePoint Online)?

Thus, in this article, we have learned the below with respect to missing the site assets library in the SharePoint Online communication site:

  • How to fix the missing site assets Library in SharePoint Online communication site.
  • How to fix the “format-default: The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.” error.
  • How to use the Get-PnPWeb command with an example.
  • How to fix the issue when we see that the asset library is missing in SharePoint Online.

See Also: Missing Site Assets Library in SharePoint Online

You may also like the below SharePoint troubleshooting articles:

Download SharePoint Online PDF Book

Download SharePoint Online & Office 365 Administration eBook

Buy the premium version of SharePoint Online & Office 365 administration eBook from here:



Buy SharePoint Online & Office 365 Administration eBook


 

Get the free demo PDF eBook from here:

FREE DOWNLOAD

Send download link to:

Subscribe to get exclusive content and recommendations every month. You can unsubscribe anytime.

 

 

 

About Post Author

1 comments on “[Fixed]: Missing Site Assets Library in SharePoint Online”

Do you have a better solution or question on this topic? Please leave a comment