SharePoint Online Modern Site Solution Link Missing Under Web Designer Galleries & Content Editor

# How to enable custom script for SharePoint Online Modern Site


If you have or create a SharePoint On-Premise site, and go to its Site Settings page, you will see the structure of "Web Designer Galleries" like this:
Classic SharePoint Option
But if you create a new SharePoint Online Modern Site and go to its Site Settings page, you will see the structure of "Web Designer Galleries" like this:
Modern SharePoint Option
Now if you want the structure of your SharePoint Online Web Designer Galleries to be exactly same as the On-Premise one, then you can achieve it using PowerShell. Please see the steps below:

 1. First open Windows PowerShell ISE app and run as Administrator.
 2. If you are using PowerShell ISE for the first-time on your machine then you will need to set the execution policy to run PowerShell commands on your computer. For setting execution policy enter the below command:

 Set-ExecutionPolicy -ExecutionPolicy Unrestricted 

Then click on "Yes to All". 

3. Then install SharePoint Online PowerShell module so that you can communicate with SharePoint Online Sites through PowerShell. Run the below command:

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

4. Now you can connect to your SharePoint Online Admin Center by entering the below commands back to back. First create a variable to store credentials of SharePoint Admin Center. To do that run below command: 

$cred = Get-Credential 

Then a pop-up would appear, and you enter your SharePoint Online Admin credentials in there.

 5. Now enter the command which will connect you to SharePoint Admin Center with the stored credential.
 Connect-SPOService -Credential $cred

 6. Now run the final command to display all options of Web Designer Galleries in your SharePoint Online Modern Site.

 Set-SPOsite -DenyAddAndCustomizePages 0

 In section you will put the SharePoint Online Site URL, in which you want to enable all options of Web Designer Galleries. You need to keep -DenyAddAndCustomizePages as 0 (false) to show all the options, you can revert -DenyAddAndCustomizePages 1(true) to hide the options back. 

7. Now go to SPO Site’s Site Settings page and refresh it, you would be able to see all the Web Designer Galleries options in there. 8. Now Disconnect the SPO Service once the purpose is fulfilled. Its always a good practice! To Disconnect run the below command: 

Disconnect-SPOService

 You can copy the commands from below:

1. Set-ExecutionPolicy -ExecutionPolicy Unrestricted
2. Install-Module -Name Microsoft.Online.SharePoint.PowerShell
3. $cred = Get-Credential
4. Connect-SPOService https://eminence2019-admin.sharepoint.com Credential $cred
5. Set-SPOsite https://eminence2019.sharepoint.com/sites/codigo 
-DenyAddAndCustomizePages 0
6. Disconnect-SPOService

1 comment:

  1. Wow, we can covert SharePoint modern to classic that's mean i will get content editor web part. is it right?

    ReplyDelete

Thanks!

Pages