1

I'm attempting to create an organizational assets library for use with company branded templates and copilot features.

I have successfully run this code on my development tenant, but when attempting to run the same code in our production tenant, I receive this error:  

This library is not on the site that contains other organization asset libraries.

I've tried this on multiple site collections and even created a new communication site, but the error persists.

# Install and import the PnP PowerShell module
Install-Module -Name PnP.PowerShell -Force -AllowClobber
Import-Module -Name PnP.PowerShell -Force


# Connect to SharePoint with MFA
$authUrl = "https://<siteurl>.sharepoint.com/sites/OrgAssets";
 $pnp = Connect-PnPOnline -Url $authUrl -Interactive
$libraryUrl = "https://<siteUrl>.sharepoint.com/sites/OrgAssets/Assets"

 Get-PnPOrgAssetsLibrary
#$test = Get-PnPOrgNewsSite -Connection $pnp

#Remove-PnPOrgAssetsLibrary -LibraryUrl $libraryUrl
Add-PnPOrgAssetsLibrary -LibraryUrl $libraryUrl #-CdnType Private -OrgAssetType OfficeTemplateLibrary

# Disconnect from SharePoint
Disconnect-PnPOnline
1
  • What happens when you run this command: Get-PnPOrgAssetsLibrary? Do you see any existing org asset library from "another" site? Jan 29 at 5:13

1 Answer 1

0

As per the Microsoft official documentation, Create an organization assets library,

All organization asset libraries must be on the same site.

So, try this:

  1. Firstly, check if you have any existing organization asset libraries in your Microsoft 365 tenant using this command:
Get-PnPOrgAssetsLibrary
  1. Create a new document library on same SharePoint site where your existing organization asset libraries are created.
  2. Run the following command to designate the new document library as an organization assets library:
Add-PnPOrgAssetsLibrary -LibraryUrl $libraryUrl

References:

  1. Get-PnPOrgAssetsLibrary
  2. Add-PnPOrgAssetsLibrary
  3. Create an Organization Assets Library in SharePoint Online
  4. Register SharePoint Document Library as an Organization Assets Library using PowerShell
1
  • 1
    Just one additional I had to add to you code to get the relative URL $orgInfo = Get-PnPOrgAssetsLibrary $orgInfo[0].LibraryUrl Feb 1 at 0:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.