SHARE
TWEET

Untitled

a guest Oct 3rd, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 'Insert information for Site'
  4. $siteurl = Read-Host "Site Url"
  5. $username = Read-Host "User Name"
  6. $password = Read-Host -AsSecureString "Password"
  7.  
  8. try
  9. {
  10.     [Microsoft.SharePoint.Client.ClientContext]$ClientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteurl)
  11.     $ClientContext.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
  12.     $site = $ClientContext.Site;
  13.  
  14.     $sideLoadingGuid = new-object System.Guid "AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D"
  15.     $site.Features.Add($sideLoadingGuid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);
  16.      
  17.     $ClientContext.ExecuteQuery();
  18.      
  19.     Write-Host -ForegroundColor Green 'SideLoading feature enabled :)'
  20. }
  21. catch
  22. {
  23.     Write-Host -ForegroundColor Red 'Error ' $siteurl, ':' $Error[0].ToString();
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top