Skip to content
English
  • There are no suggestions because the search field is empty.

Guide for creating shared templates for Office templates

Make sure the templates are saved in the correct format, e.g. .dotx, .potx.

 

Place the files in the correct folder that will distribute the templates.
Create a Team in Teams called “Templates”, then create a new document library (this is to prevent the General folder from appearing in the Office apps).

image-png-May-27-2024-07-09-51-6947-AM

Grant Everyone except external users Read access (break inheritance) on the library.

image-png-Jun-05-2025-11-07-22-1448-AM

 

Follow these steps:

# Variabler
$tenant   = "DOMAIN"  # byt till ditt tenantnamn (utan .onmicrosoft.com)
$adminUrl = "https://$tenant-admin.sharepoint.com/"
$libUrl   = "https://$tenant.sharepoint.com/sites/Templates/Office%20Templates"  # dokumentbibliotekets URL

# Säkerställ modul
if (-not (Get-Module -ListAvailable -Name Microsoft.Online.SharePoint.PowerShell)) {
    Write-Host "Installerar SharePoint Online Management Shell..." -ForegroundColor Yellow
  Install-Module Microsoft.Online.SharePoint.PowerShell -Force
}
Import-Module Microsoft.Online.SharePoint.PowerShell -Force

# Anslut
Connect-SPOService -Url $adminUrl

# Aktivera Private CDN om det inte redan är på
$cdnEnabled = Get-SPOTenantCdnEnabled -CdnType Private
if (-not $cdnEnabled) {
    Write-Host "Aktiverar Private CDN..." -ForegroundColor Yellow
    Enable-SPOTenantCdn -CdnType Private
}

# Lägg till Org Assets Library om det saknas
$existing = Get-SPOOrgAssetsLibrary | Where-Object { $_.LibraryUrl -eq $libUrl -and $_.OrgAssetType -eq "OfficeTemplateLibrary" }
if (-not $existing) {
    Write-Host "Registrerar Org Assets Library för Office-mallar..." -ForegroundColor Yellow
    Add-SPOOrgAssetsLibrary -LibraryUrl $libUrl -OrgAssetType OfficeTemplateLibrary -CdnType Private
} else {
    Write-Host "Org Assets Library finns redan: $($existing.LibraryUrl)" -ForegroundColor Green
}

# Visa status
Write-Host "`n[Org Assets Libraries]" -ForegroundColor Cyan
Get-SPOOrgAssetsLibrary | Format-List LibraryUrl, OrgAssetType, ThumbnailUrl, Notes

Write-Host "`n[Private CDN Origins]" -ForegroundColor Cyan
Get-SPOTenantCdnOrigins -CdnType Private