{"id":1488,"date":"2013-11-27T05:56:45","date_gmt":"2013-11-27T05:56:45","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=1488"},"modified":"2024-04-26T12:43:48","modified_gmt":"2024-04-26T12:43:48","slug":"smoothly-activating-a-feature-across-sharepoint-site-collections","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/smoothly-activating-a-feature-across-sharepoint-site-collections\/","title":{"rendered":"Smoothly activating a Feature across SharePoint Site Collections"},"content":{"rendered":"<p>It\u2019s useful to be able to activate features across site collections. This two line script grabs the desired feature, then grabs the collection of Site Collections and pipes them into a Feature Activation CmdLet masking errors; errors occur such as when activating a feature that is already activated.<\/p>\n<pre lang=\"php\">\r\n$defaultOpenBehaviorFeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq \"OpenInClient\"}).Id\r\nGet-SPSite -limit ALL | foreach { enable-SPFeature $defaultOpenBehaviorFeatureId -url $_.URL -ErrorAction SilentlyContinue }\r\n<\/pre>\n<p>This is with a sample filter:<\/p>\n<pre lang=\"php\">\r\n$defaultOpenBehaviorFeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq \"OpenInClient\"}).Id\r\nGet-SPSite  -limit all | where {$_.url -like \"ht tp:\/\/SharePoint dev\/ThisPath\/*\"}  | foreach { enable-SPFeature $defaultOpenBehaviorFeatureId -url $_.URL -ErrorAction SilentlyContinue }\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>It\u2019s useful to be able to activate features across site collections. This two line script grabs the desired feature, then grabs the collection of Site Collections and pipes them into a Feature Activation CmdLet masking errors; errors occur such as when activating a feature that is already activated. $defaultOpenBehaviorFeatureId = $(Get-SPFeature -limit all | where [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":1490,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[26],"tags":[],"class_list":["post-1488","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=1488"}],"version-history":[{"count":3,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1488\/revisions"}],"predecessor-version":[{"id":1492,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1488\/revisions\/1492"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/1490"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=1488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=1488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=1488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}