在SharePoint Online中使用Designer报错,错误为:This Feature has been disabled by your administrator.找了好久发现原因,分享给大家。 1、在SharePoint Online的列表中,点击编辑列表,如下图: 2、弹出确认对话......
2021-06-25 122 使用Designer报错
最近,有个需求,就是需要批量更新列表内容,平时这些操作,都用powershell去完成,但是,powershell需要在服务器上操作,而服务器权限需要通过客户的层层把关,所以,这次就考虑不用命令了,而改用SharePoint网站工作流,然后,用powershell命令去创建任务计划。
这样,以后有需求修改,直接在客户端就能做了,而任务计划,是始终不会变的。
1.创建网站工作流,这个就比较简单了,我们就不多少了,直接在SharePoint Designer里干就好了;
2.启动网站工作流的PowerShell代码段,这个显然是本文的重中之重;
复制代码
# SharePoint.Workflow.Start-SPSiteWorkflow
param (
[string]$Url = "http://sharepoint/demos/workflow",
[string]$Workflow = "Sample Site Workflow"
)
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction
SilentlyContinue
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
# get the workflow assocation from the target site/web
$site = Get-SPSite $Url
$culture = [System.Globalization.CultureInfo]::InvariantCulture
$wfAssociation = $site.RootWeb.WorkflowAssociations.GetAssociationByName($Workflow,$culture)
if ( $wfAssociation )
{
# initialize and optionally update association data
$assocData = $wfAssociation.AssociationData
# start the workflow
$wfRunOption = [Microsoft.SharePoint.Workflow.SPWorkflowRunOptions]::Asynchronous
$site.WorkflowManager.StartWorkflow($site, $wfAssociation, $assocData,$wfRunOption)
}
else
{
Write-Error "Workflow association not found on target web site."
}
复制代码
3.保存成ps1文件,然后,创建一个任务计划定时去执行就好了;
4.创建任务计划可以参考:
https://www.cnblogs.com/jianyus/p/10341253.html
结束语
SharePoint的好处就在于是个平台,很多功能有多种多样的方式来完成,而我们可以根据需求,选中最最适合我们场景的那一个。
当然,这些就需要我们对SharePoint有这深入的了解,方方面面的功能都很熟悉了。
标签: PowerShell启动工作流
相关文章
在SharePoint Online中使用Designer报错,错误为:This Feature has been disabled by your administrator.找了好久发现原因,分享给大家。 1、在SharePoint Online的列表中,点击编辑列表,如下图: 2、弹出确认对话......
2021-06-25 122 使用Designer报错
roblem: NodeRunner.exe is consuming a lot of memory and CPU resulted in performance issues on SharePoint 2013 server. Solution: NodeRunner.exe is a SharePoint 2013 Search service component and it is resource hungry. To reduce the CPU and Memory impac......
2021-06-25 963 How,Limit,NodeRunner.exe,High,Memory,CPU,Usage,roblem,
最近有个新需求,用户希望标题栏可以拖动宽度,其实觉得没什么用,既然用户要了又推不掉,就勉为其难实现一下吧。 其实原理比较简单,就是利用JavaScript对标题栏进行宽度控制,然后从网......
2021-06-25 167 SharePoint列表标题列宽度可拖动
最近有个需求,写个定时迁移文件夹的小程序,因为计时器任务比较繁琐,所以选择了控制台程序。然后,用windows的计划任务执行,也许,会有广大朋友需要类似的功能,简单的分享一下代码......
2021-06-25 201 SharePoint服务器端对象迁移
本文介绍如何在Office 365中创建列表库,以及列表库的一些基本设置。 通过登录地址登录到Office 365的SharePoint Online站点中,我们可以在右上角的设置菜单中,选择添加应用程序; 或者,进入网......
2021-06-25 329 SharePoint创建列表库