2

I want to activate a webfeature on all subsites of a sitecollection in Office 365 / SharePoint online.

I thought i can do the actions in a SiteCollection Feature, but that's throwing a timeout error. So I create a webfeature. But how can i enable it on al sites?

Is there an Powershell Example, or another solution?

1

Unfortunately there are no PowerShell script for feature activation, on a SPO-site. The only available script are listed in the technet article Index of Windows PowerShell for SharePoint Online cmdlets.

Instead you need to activate the feature on each subsite, but if you have a list of the subsite URL:s it's fairly quick if you copy-paste the URL below after the subsite url:

https://my-spo-root-url/subsite-url/_layouts/15/start.aspx#/_layouts/15/ManageFeatures.aspx
0

It might be a bit late now but you can use a the SharePoint Online Automation cmdlets https://sharepointonlineautomationcmdlets.codeplex.com/ to do this. Just write a function which uses Get-SPOSubWebs and runs through all of the subsites recursively and use the Install-SPOWebFeature cmdlet to activate the features.

Something like

$ctx = Get-SPOContext url username password
Install-SPOWebFeature -Web $ctx.Web -FeatureId {some id}

Get-SPOSubWebs -Web $ctx.Web | ForEach-Object {
   Install-SPOWebFeature -Web $_ -FeatureId {some id}
}

Would do the first level.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.