我们开始在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
发布评论