How to enable a SharePoint Online Feature using PowerShell!

This script shows how to enable a SharePoint Online feature using the Client Side Object Model. The script defines a function that receives the following parameters: SharePoint Online site url, SharePoint Online user credentials and the Guid of the feature to be enabled. Once the

 
 
 
 
 
4.9 Star
(10)
4,435 times
Add to favorites
Office 365
11/20/2014
E-mail Twitter del.icio.us Digg Facebook
  • Since some features take longer period to activate, the script is giving timeout issue.
    2 Posts | Last post November 17, 2019
    • While activating certain features the script is throwing Timeout error: Exception calling "ExecuteQuery" with "0" argument(s): "The operation has timed out"
    • Could you please tell me what features are you trying to actívate?
  • Using with Azure Mulifactor Authentication
    2 Posts | Last post November 17, 2019
    • How can I use this together with Azure Multifactor Authentication.  This script asks for a text username and password, rather than evoking the login page that allows MFA login.
    • To avoid MFA with CSM I would recommend to take a look a PnP Libraries that extend OOB CSM
  • Thanks!
    2 Posts | Last post November 17, 2019
  • I can able to activate feature using your script.
    2 Posts | Last post July 30, 2017
    • But how to deactivate the feature using powershell?
    • Here you are: https://gallery.technet.microsoft.com/office/Activate-or-deactivate-a-9fe2fb34
  • ----
    1 Posts | Last post July 08, 2017
  • How can I use this to active a web feature?
    2 Posts | Last post November 18, 2016
    • I activated the SharePoint Server Publishing Infrastructure with this, since I couldn't do it using the UI. But then I tried activating SharePoint Server Publishing on the site and it failed. So I thought I would try with this script. I passed it the correct GUID for the Feature. But I get an error that the 
      "Microsoft.SharePoint.Client.ServerException: Feature '94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb' is Web-scoped, and cannot be added to the Site."
      
      So, can I use PowerShell to enable this feature?
    • Ey Lucho1970, try to change the scope property to Web Scope
  • Great code!
    2 Posts | Last post November 18, 2016