Sunday, 30 June 2019

SharePoint Online Allow custom scripts - Part 3

We have looked at why Microsoft disabled custom scripts in SharePoint Online and where it affects. We have looked in previous two blogs why and what is alternative. If you have not gone through that, please check below links.




In this post, we are going to review how to enable custom scripting on site collection level and what will be its impact.

So if we enable scripting at tenant level we may end up loosing control over security. Instead Microsoft Provided a way to enable scripting at site collection level.

Prerequisite:


  • SharePoint Online Management Shell 


Follow below steps to enable scripting at site collection level:

  • Open the SharePoint Online Management Shell console. 
  • Execute the command to connect the Office 365 :

    Connect-SPOService -Url https://tenant-admin.sharepoint.com
  • Execute the command bellow with the url for the site collection where you want to enable scripting:

    Set-SPOSite -Identity https://tenant.sharepoint.com/sites/contoso -DenyAddAndCustomizePages 0


Pros:


  • Tenant level scripting enable may take up to 24 hours. But this approach disable the scripting block immediately. 
  • As this settings are enabled at specific site collection, you can make sure the scripting do not affect other site collections or tenant.

Conclusion:

We have seen limitations and how to overcome that. If you need to enable scripting, choose the settings as per your need.

Saturday, 27 April 2019

SharePoint Online Allow custom scripts - Part 2

We have looked at why Microsoft disabled custom scripts in SharePoint Online and where it affects. If you have not gone through that, please click here to read it.
In this post, we are going to review how to enable custom scripting on tenant level and what will be its impact.

Enable Scripting at the Site Collection Level 

Follow the below steps to “Enable” the custom script at the tenant level:
  • Login into your Office 365 Admin Portal.
    URL - https://admin.microsoft.com
    Click on ellipses in the left side panel.

    Note:  If you have Office 365 Germany, sign in at https://portal.office.de. If you have Office 365 operated by 21Vianet (China), sign in at https://login.partner.microsoftonline.cn/. Then select the Admin tile to open the admin center.
  • Then, it will display all the menu option in the panel. Scroll down and hover on "Admin" center menu and click on "SharePoint" as shown below image.
  • It will open the SharePoint admin page. In the left navigation, select 'Settings'.
  • It will navigate to the settings page. Scroll down till "Custom Script" section. In this select "Allow users to run a custom script on personal sites" & "Allow users to run a custom script on self-service created sites" as shown in below image:
  • Then scroll down to the end of the page and click “OK”. It will take about 24 hours for the changes to take effect.
 
Once these settings are implemented, you will have your classic SharePoint available same as you know. But this also enables the threat that we discussed in the first part. So we would not recommend this approach. 
So what is the alternative? Check out our last post of this topic for same. 

 Reference Link