Skip to main content
Commonmark migration
Source Link

Download and install: Powershell ISE: https://www.microsoft.com/en-us/download/details.aspx?id=45885

 

Download and install: SharePoint online client components SDK: https://www.microsoft.com/en-us/download/details.aspx?id=42038

Modify the attached scripts Required Parameters for your SharePoint and the feature code found in the error code you are receiving:

Download and install: Powershell ISE: https://www.microsoft.com/en-us/download/details.aspx?id=45885

 

Download and install: SharePoint online client components SDK: https://www.microsoft.com/en-us/download/details.aspx?id=42038

Modify the attached scripts Required Parameters for your SharePoint and the feature code found in the error code you are receiving:

Download and install: Powershell ISE: https://www.microsoft.com/en-us/download/details.aspx?id=45885

Download and install: SharePoint online client components SDK: https://www.microsoft.com/en-us/download/details.aspx?id=42038

Modify the attached scripts Required Parameters for your SharePoint and the feature code found in the error code you are receiving:

Source Link
Gennady G
  • 1.6k
  • 3
  • 22
  • 38

If feature is hidden:

Download and install: Powershell ISE: https://www.microsoft.com/en-us/download/details.aspx?id=45885

Download and install: SharePoint online client components SDK: https://www.microsoft.com/en-us/download/details.aspx?id=42038

Modify the attached scripts Required Parameters for your SharePoint and the feature code found in the error code you are receiving:

#Required Parameters 
$sSiteColUrl = "https://portal.sharepoint.com"
$sUserName = "[email protected]"  
$sFeatureGuid="2a6bf8e8-10b5-42f2-9d3e-267dfb0de8d4" 
$sPassword = Read-Host -Prompt "Enter your password: " -AsSecureString 

Run the powershell ISE as Administrator Run script

#Script that enables a feature in a SPO Site 
# Required Parameters: 
#  -> $sUserName: User Name to connect to the SharePoint Online Site Collection. 
#  -> $sPassword: Password for the user. 
#  -> $sSiteColUrl: SharePoint Online Site Collection 
#  -> $sFeatureGuid: GUID of the feature to be enabled 
    
     
    $host.Runspace.ThreadOptions = "ReuseThread" 
     
    #Definition of the function that allows to enable a SPO Feature 
    function Enable-SPOFeature 
    { 
        param ($sSiteColUrl,$sUserName,$sPassword,$sFeatureGuid) 
        try 
        {     
            #Adding the Client OM Assemblies         
            Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" 
            Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" 
     
            #SPO Client Object Model Context 
            $spoCtx = New-Object Microsoft.SharePoint.Client.ClientContext($sSiteColUrl)  
            $spoCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($sUsername, $sPassword)   
            $spoCtx.Credentials = $spoCredentials       
     
            Write-Host "----------------------------------------------------------------------------"  -foregroundcolor Green 
            Write-Host "Enabling the Feature with GUID $sFeatureGuid !!" -ForegroundColor Green 
            Write-Host "----------------------------------------------------------------------------"  -foregroundcolor Green 
     
            $guiFeatureGuid = [System.Guid] $sFeatureGuid 
            #############################################
            # todo: change object: $spoSite=$spoCtx.Site | $spoSite=$spoCtx.Web
            $spoSite=$spoCtx.Site 
    
            # todo: change scope: [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None | Farm | Site | Web
            # https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.featuredefinitionscope.aspx?f=255&MSPPError=-2147217396
            $spoSite.Features.Add($sFeatureGuid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None) 
            #############################################
    
            $spoCtx.ExecuteQuery() 
            $spoCtx.Dispose() 
        } 
        catch [System.Exception] 
        { 
            write-host -f red $_.Exception.ToString()    
        }     
    } 
     
    #Required Parameters 
    $sSiteColUrl = "https://portal.sharepoint.com" 
    $sUserName = "[email protected]" 
    $sFeatureGuid= " e995e28b-9ba8-4668-9933-cf5c146d7a9f"
    $sPassword = Read-Host -Prompt "Enter your password: " -AsSecureString  
     
    Enable-SPOFeature -sSiteColUrl $sSiteColUrl -sUserName $sUserName -sPassword $sPassword -sFeatureGuid $sFeatureGuid

https://techcommunity.microsoft.com/t5/SharePoint/MobileExcelWebAccess-Feature-Site-Template-Error/td-p/2531