1000多个子站点中的全局分类/站点策略和脚本编辑器Webpart

编程入门 行业动态 更新时间:2024-10-21 18:35:19
本文介绍了1000多个子站点中的全局分类/站点策略和脚本编辑器Webpart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们开始在SharePoint 2013环境中实施网站分类/网站策略. 我们的网站集包含1000多个子网站,我们想看看是否有一种方法可以在所有网站上设置默认网站分类/网站政策. 我们将从站点分类和更大的安全审核开始. 我们希望最终结果的一个示例是此处的方案3. dev.office/patterns-and-practices-detail/1931 是否有一个PowerShell脚本可将所有这些子站点设置为我们选择的默认分类/站点策略? 除了默认分类之外,我们还要在显示站点描述的每个页面的顶部插入脚本编辑器Webpart. 也可以通过PowerShell插入此内容吗? 此脚本编辑器Webpart的代码为: < script> _spBodyOnLoadFunctionNames.push("GetSiteInfo"); var site; function GetSiteInfo() { var ctx = new SP.ClientContext.get_current(); site = ctx.get_web(); ctx.load(site); ctx.executeQueryAsync(onQuerySucceeded,onQueryFailed); } function onQueryFailed(sender,args){ 警报('request failed'+ args.get_message()+'\ n'+ args.get_stackTrace()); } function onQuerySucceeded(sender,args){ var desc = document.getElementById('divSiteDescription') desc.innerHTML = site.get_description(); } </script> < div id ='divSiteDescription'></div>

解决方案

您可以循环浏览网站,然后以编程方式设置网站策略.

sharepointfonder.blogspot .sg/2014/10/applying-site-policy-programmatically.html

tech. bool.se/以编程方式创建设置-使用-自定义站点策略/

并使用PowerShell将脚本编辑器Web部件添加到页面中,请参考以下链接中的演示:

sharepointpals/post/How-to-Add-Script-Editor-WebParts-to-SharePoint-2013-Publishing-Pages-using-PowerShell

最好的问候

维多利亚

We are beginning to implement site classifications/site policies in our SharePoint 2013 environment. Our site collection has 1000+ sub-sites and we'd like to see if there's a way to set a default site classification/site policy on all sites since we will be starting with site classification and greater security auditing. An example of what we'd like as an end result would be Scenario 3 here >> dev.office/patterns-and-practices-detail/1931 Is there a PowerShell script to set all these sub-sites as a default classification/site policy of our choice? In addition to the default classification, we want to insert a script editor webpart on the top of each page that displays the site description. Is there a way to insert this via PowerShell too? Our code for this script editor webpart is: <script> _spBodyOnLoadFunctionNames.push("GetSiteInfo"); var site; function GetSiteInfo() { var ctx = new SP.ClientContext.get_current(); site = ctx.get_web(); ctx.load(site); ctx.executeQueryAsync(onQuerySucceeded, onQueryFailed); } function onQueryFailed(sender, args) { alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace()); } function onQuerySucceeded(sender, args) { var desc = document.getElementById('divSiteDescription') desc.innerHTML = site.get_description(); } </script> <div id='divSiteDescription'></div>

解决方案

Hi,

You can loop through the sites and then set the site policy programmatically.

sharepointfonder.blogspot.sg/2014/10/applying-site-policy-programmatically.html

tech.bool.se/programmatically-create-setup-use-custom-site-policy/

And to add a script editor web part to a page with PowerShell, please refer to the demo in the link below:

sharepointpals/post/How-to-Add-Script-Editor-WebParts-to-SharePoint-2013-Publishing-Pages-using-PowerShell

Best Regards,

Victoria

更多推荐

1000多个子站点中的全局分类/站点策略和脚本编辑器Webpart

本文发布于:2023-11-28 13:12:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642549.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:站点   多个   编辑器   全局   脚本

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!