question

IMK-3051 avatar image
0 Votes"
IMK-3051 asked EmilyDu-MSFT commented

Uploading list template to modern site

Hi

We have a classic site, which holds a list that we need to move to another modern site. The modern site is a group site with Teams team linked.

I can create a template of the list in the classic site, and in classic site in Site Settings -page, I can see List Templates -link under Web Designer Galleries. From there, I am able to download the .stp file.

Problem here is that when I go to Site Settings of the modern site, where we need to move the list, I can't see List Templates -link. If I use the List Templates URL of my modern group site (http://company.sharepoint.com/sites/group.site/_catalogs/lt/Forms/AllItems.aspx), I can access the List Template Gallery, but when I try to upload the list template, I get error message "Sorry, you don't have access.".

I have Full Control, I am owner of the modern site and I have direct Designer permission. Still I can't see the List Templates -link in Site Settings and get the error that I don't have access..

What is wrong here?

Below is a screen shot of my permissions in the modern site.

95939-permissions.png


office-sharepoint-online
permissions.png (196.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

EmilyDu-MSFT avatar image
0 Votes"
EmilyDu-MSFT answered EmilyDu-MSFT edited

@IMK-3051

Please run below PowerShell as administrator to enable custom script in the SharePoint Online site collection.

 #Config Parameters
 $AdminSiteURL="https://tenant-admin.sharepoint.com/"
 $SiteURL="site collection URL "
    
 $Cred = Get-Credential
 Connect-SPOService -URL $AdminSiteURL -Credential $Cred
    
 Set-SPOSite -Identity $SiteURL -DenyAddAndCustomizePages $False

If an Answer is helpful, please click "Accept Answer" and upvote it
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.






5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

IMK-3051 avatar image
0 Votes"
IMK-3051 answered IMK-3051 commented

Hi

I tried PowerShell but no go. Below what I came up with.

 PS C:\WINDOWS\System32> Get-SPOSite -Identity $SiteURL -Detailed | select DenyAddAndCustomizePages
    
 DenyAddAndCustomizePages
 ------------------------
                  Enabled
    
    
 PS C:\WINDOWS\System32> Set-SPOSite $SiteURL -DenyAddAndCustomizePages $False
 Set-SPOSite : https://company.sharepoint.com/sites/group.team is a Groups site collection. The valid parameters for thi
 s type of site collection are '-Identity', '-AllowSelfServiceUpgrade', '-DefaultLinkPermission', '-DefaultSharingLinkTy
 pe', '-DenyAddAndCustomizePages', '-DisableCompanyWideSharingLinks', '-DisableSharingForNonOwners', '-LockState', '-Own
 er', '-ResourceQuota', '-ResourceQuotaWarningLevel', '-SandboxedCodeActivationCapability', '-SharingCapability', '-Show
 PeoplePickerSuggestionsForGuestUsers', '-SocialBarOnSitePagesDisabled', '-StorageQuota', '-StorageQuotaReset', and '-St
 orageQuotaWarningLevel'.
 At line:1 char:1
 + Set-SPOSite $SiteURL -DenyAddAndCustomizePages $False
 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : NotSpecified: (:) [Set-SPOSite], ServerException
     + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSi
    te
    
 PS C:\WINDOWS\System32> Set-SPOSite $SiteURL -DenyAddAndCustomizePages 0
 Set-SPOSite : https://company.sharepoint.com/sites/group.team is a Groups site collection. The valid parameters for thi
 s type of site collection are '-Identity', '-AllowSelfServiceUpgrade', '-DefaultLinkPermission', '-DefaultSharingLinkTy
 pe', '-DenyAddAndCustomizePages', '-DisableCompanyWideSharingLinks', '-DisableSharingForNonOwners', '-LockState', '-Own
 er', '-ResourceQuota', '-ResourceQuotaWarningLevel', '-SandboxedCodeActivationCapability', '-SharingCapability', '-Show
 PeoplePickerSuggestionsForGuestUsers', '-SocialBarOnSitePagesDisabled', '-StorageQuota', '-StorageQuotaReset', and '-St
 orageQuotaWarningLevel'.
 At line:1 char:1
 + Set-SPOSite $SiteURL -DenyAddAndCustomizePages 0
 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : NotSpecified: (:) [Set-SPOSite], ServerException
     + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSi
    te
    
 PS C:\WINDOWS\System32>


Also, I checked Sharepoint Admin Center Settings and found that custom scripting should be enabled already. Below screen shot shows the situation what it has been all the time. I haven't changed those settings.

96216-nayttokuva-2021-5-13-kello-102639.png





· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@IMK-3051

The settings in the admin center only enable the custom script in the tenant level. You should enable the custom script in the site collection level.

You use this PowerShell "Get-SPOSite -Identity $SiteURL -Detailed | select DenyAddAndCustomizePages" to get "DenyAddAndCustomizePages" is enable, it indicates that the custom script is disable in the site collection level.

I have updated the PowerShell in the answer, please check.

If you get an error when running PowerShell, please provide the screenshot.

0 Votes 0 ·

Hi

I did do Get-SPOSite command. It's the first 5 rows in my previous answer.

And I don't see any changes in the PowerShell?? The Set-SPOSite row in your PowerShell command is the same. I tested that already and the result is in my previous answer.

0 Votes 0 ·

@IMK-3051

Please provide the full screenshot when you run PowerShell.

0 Votes 0 ·
IMK-3051 avatar image
0 Votes"
IMK-3051 answered EmilyDu-MSFT commented

You can find the commands and results in my previous answer??

It is straight copy from PowerShell window and show's the commands that I used and results I got.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@IMK-3051

You should update the SharePoint PowerShell module into the latest version.

Please run below PowerShell as administrator.

 Install-Module -Name Microsoft.Online.SharePoint.PowerShell  -Force


0 Votes 0 ·
IMK-3051 avatar image
0 Votes"
IMK-3051 answered EmilyDu-MSFT commented

Hi

It didn't help.

 PS C:\WINDOWS\system32>  Install-Module -Name Microsoft.Online.SharePoint.PowerShell  -Force
 PS C:\WINDOWS\system32> Connect-SPOService
    
 cmdlet Connect-SPOService at command pipeline position 1
 Supply values for the following parameters:
 Url: https://company-admin.sharepoint.com
    
 PS C:\WINDOWS\system32> $SiteURL="https://company.sharepoint.com/sites/group.team"
 PS C:\WINDOWS\system32> Get-SPOSite -Identity $SiteURL -Detailed | select DenyAddAndCustomizePages
    
 DenyAddAndCustomizePages
 ------------------------
                  Enabled
    
    
 PS C:\WINDOWS\system32> Set-SPOSite $SiteURL -DenyAddAndCustomizePages $False
 Set-SPOSite : https://company.sharepoint.com/sites/group.team is a Groups site collection. The valid parameters for thi
 s type of site collection are '-Identity', '-AllowSelfServiceUpgrade', '-DefaultLinkPermission', '-DefaultSharingLinkTy
 pe', '-DenyAddAndCustomizePages', '-DisableCompanyWideSharingLinks', '-DisableSharingForNonOwners', '-LockState', '-Own
 er', '-ResourceQuota', '-ResourceQuotaWarningLevel', '-SandboxedCodeActivationCapability', '-SharingCapability', '-Show
 PeoplePickerSuggestionsForGuestUsers', '-SocialBarOnSitePagesDisabled', '-StorageQuota', '-StorageQuotaReset', and '-St
 orageQuotaWarningLevel'.
 At line:1 char:1
 + Set-SPOSite $SiteURL -DenyAddAndCustomizePages $False
 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : NotSpecified: (:) [Set-SPOSite], ServerException
     + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSi
    te
    
 PS C:\WINDOWS\system32> Set-SPOSite $SiteURL -DenyAddAndCustomizePages 0
 Set-SPOSite : https://company.sharepoint.com/sites/group.team is a Groups site collection. The valid parameters for thi
 s type of site collection are '-Identity', '-AllowSelfServiceUpgrade', '-DefaultLinkPermission', '-DefaultSharingLinkTy
 pe', '-DenyAddAndCustomizePages', '-DisableCompanyWideSharingLinks', '-DisableSharingForNonOwners', '-LockState', '-Own
 er', '-ResourceQuota', '-ResourceQuotaWarningLevel', '-SandboxedCodeActivationCapability', '-SharingCapability', '-Show
 PeoplePickerSuggestionsForGuestUsers', '-SocialBarOnSitePagesDisabled', '-StorageQuota', '-StorageQuotaReset', and '-St
 orageQuotaWarningLevel'.
 At line:1 char:1
 + Set-SPOSite $SiteURL -DenyAddAndCustomizePages 0
 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : NotSpecified: (:) [Set-SPOSite], ServerException
     + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSi
    te
    
 PS C:\WINDOWS\system32>
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@IMK-3051

You could try to reinstall SharePoint Online Management Shell then run the PowerShell.

0 Votes 0 ·