Enabling SideLoading in SharePoint Online for Non-Developer Site

Note 1: By default this feature is enabled in “Developer Site”. So if your site has been created with the “Developer Site” template then do not use this article since this is for non-developer sites.

Note 2: Enabling this feature is not recommended for production sites. Sideloading apps is insecure. The main reason for blocking sideloading by default on non-developer sites is the risk that faulty apps pose to their host web/host site collection. Apps have the potential to destroy data and make sites or, given enough permissions, can even make site collections unusable. Therefore, apps should only be sideloaded in dev/test environments and never in production.

(Referenece: Apps for Office and SharePoint blog)

Pre-requisites
  • Install Windows PowerShell from Windows Management Framework (I installed the Windows Management Framework 3.0).
  • Then install “SharePoint Online Management Shell” Link.
Procedure
  • Execute a PowerShell script in any desktop not requiring a SharePoint Server (of course that’s the purpose of SharePoint Online).
  • Be sure you enable “ExecutionPolicy” in the client desktop where your PowerShell will be executed.
  • Open “SharePoint Online Management Shell” with “Run as Administrator” and execute Set-ExecutionPolicy RemoteSigned
     
    Screenshot for reference only,


  • Now execute the PowerShell from “SharePoint Online Management Shell”.
  • The PowerShell script is provided here and also attached to the article.

    Code
    1. $programFiles = [environment]::getfolderpath("programfiles")  
    2. add - type - Path $programFiles '\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll'  
    3. Write - Host 'Ready to enable Sideloading'  
    4. $siteurl = Read - Host 'Site Url'  
    5. $username = Read - Host "User Name"  
    6. $password = Read - Host - AsSecureString 'Password'  
    7.   
    8. $outfilepath = $siteurl - replace ':''_' - replace '/''_'  
    9.   
    10. try {  
    11.     [Microsoft.SharePoint.Client.ClientContext] $cc = New - Object Microsoft.SharePoint.Client.ClientContext($siteurl)[Microsoft.SharePoint.Client.SharePointOnlineCredentials] $spocreds = New - Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)  
    12.     $cc.Credentials = $spocreds  
    13.     $site = $cc.Site;  
    14.   
    15.     $sideLoadingGuid = new - object System.Guid "AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D"  
    16.     $site.Features.Add($sideLoadingGuid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);  
    17.   
    18.     $cc.ExecuteQuery();  
    19.   
    20.     Write - Host - ForegroundColor Green 'SideLoading feature enabled on site'  
    21.     $siteurl#Activate the Developer Site feature  
    22. catch {  
    23.     Write - Host - ForegroundColor Red 'Error encountered when trying to enable SideLoading feature'  
    24.     $siteurl, ':'  
    25.     $Error[0].ToString();  
    26. }  
  • Now you are all ready to deploy your apps into the SharePoint Online Site.

Comments


  1. Travel to India in air-conditioned comfort to visit one of the world's most iconic monuments. The Taj Mahal is probably the best known monument to love that was ever built.

    GOLDEN TRIANGLE TOUR 3 DAYS 2 NIGHTS
    GOLDEN TRIANGLE TOUR 4 DAYS 3 NIGHTS
    GOLDEN TRIANGLE TOUR 5 DAYS 4 NIGHTS
    GOLDEN TRIANGLE TOUR WITH AJMER PUSHKAR
    GOLDEN TRIANGLE WITH RANTHAMBORE JAIPUR DELHI
    TAJMAHAL SUNRISE TOUR
    TAJ MAHAL SAME DAY TOUR

    For more information

    Thank & Regard
    Vicky
    Visit our website https://www.goldentajtours.com/
    Email : goldentajtours2@gmail.com
    phone : +919997349090, +919897070013,+918395877144

    ReplyDelete

Post a Comment

Popular posts from this blog

Run Powershell script on Remote Computer/Server

Power BI Refresh Issue: unable to convert the value '' from the source data type 'VT_BSTR' to the expected data type 'VT_I8.

SPDActivities - DP.SharePoint.Workflow - Workflow failed to run