0

I have added a Farm scope feature stapler that staples an existing feature and that existing feature deploys master page. When i create a new site collection, the master page deploys automatically. I have many site collections that are already created before feature stapling. Now my question is how the feature stapling will effect the existing site collections?

enter image description here Is there any way to do this by Power Shell?

  • 1
    First try to manually activate the feature on already created site collection. Make sure it works. Then you can easily automate it using PowerShell – Amal Hashim Jan 28 '15 at 15:15
1

Stapling only affects new Sites.

You can use PowerShell to iterate all your sites and activate your MasterPage Feature

Ge-SPWebApplication "your web app url" | Get-SPSite -Limit all | %{ Enable-SPFeature -ID "<Your Feature ID>" -Url $_.Url }
|improve this answer|||||
  • How i specify from which web app it should iterate all the site collections? – SPBeginer Feb 5 '15 at 8:13
  • Get-SPWebApplication "http://...." | Get-SPSite -Limit all | %{ Enable-SPFeature -ID "<Your Feature ID>" -Url $_ } – Choggo Feb 5 '15 at 9:01
  • Wehn i run this command, i got following error: Enable-SPFeature : Feature 'App.mysite_FeatureStapler' <ID: 3bbc42b7-4cfr8-4afc4-a4f489bfbfbf4> is already activated at scope Farm. But i could not see master page deployed on existing site Collections? that means it feature did not activated on existing site Collections? – SPBeginer Feb 5 '15 at 9:15
  • what's the ID for you masterpage's feature? – Choggo Feb 5 '15 at 9:17
  • I have now changed the feature id in the command with Masterpage feature and now getting invalid URI error: See above i have modified the question and added an error sketch – SPBeginer Feb 5 '15 at 9:56

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.