停用 MySite 上的网站集功能
我们有一个自定义母版页,根据这些说明部署到 MySite Web 应用程序 - http://www.sharepointblog.com/ 2008/07/sp2007-custom-master-pages-on-subsites.html
但是,我们需要能够在 MySite Web 应用程序内的所有网站集上停用该功能。该功能构建为网站集范围。我们如何在可能拥有 3000 多个 MySites 的应用程序上停用它们?
We have a custom master page that is deployed to the MySite web application per these instructions -
http://www.sharepointblog.com/2008/07/sp2007-custom-master-pages-on-subsites.html
However, we require the ability to deactivate the feature on all the site collections that are within the MySite webapplication. The feature is built as a site collection scope. How would we deactivate them on an application that has potentially 3000+ MySites?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将构建一个简单的控制台应用程序,它会迭代 Web 应用程序的所有网站集 (MySites) 并停用该功能。您必须以提升权限运行这段代码 (SPSecurity.RunWithElevatedPrivileges),以便您有权停用网站集功能。
I would build a simple console application which iterates over all site collections (MySites) of your web application and deactivates the feature. You'll have to run this piece of code with elevate privileges (SPSecurity.RunWithElevatedPrivileges) so you have the permission to deactivate a site collection feature.
该代码也可以钉入母版页中。
仅 site.Features.Remove(new Guid("将您的功能 id 放在这里"));应该保留。
This code can be stapled into the masterpage too.
Only site.Features.Remove(new Guid("place your feature id here")); should remain.