本篇文章给大家谈谈sharepoint分享文件,以及sharepoint office对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。 本文目录一览: 1、如何将Excel表格变为共享文件 2、ppt......
2023-12-26 0 sharepoint分享文件
最近,有个需求,就是需要批量更新列表内容,平时这些操作,都用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启动工作流
[免责声明]本文来源于网络,不代表本站立场,如转载内容涉及版权等问题,请联系邮箱:83115484#qq.com,#换成@即可,我们会予以删除相关文章,保证您的权利。转载请注明出处:http://www.tutorialesandroide.com/wps/sharepoint/429.html
相关文章
本篇文章给大家谈谈sharepoint分享文件,以及sharepoint office对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。 本文目录一览: 1、如何将Excel表格变为共享文件 2、ppt......
2023-12-26 0 sharepoint分享文件
本篇文章给大家谈谈sharepoint如何搭建网盘,以及sharepoint搭建网站对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。 本文目录一览: 1、sharepoint是什么软件?有什么作用......
2023-12-18 0 sharepoint如何搭建网盘
今天给各位分享sharepoint网站功能管理的知识,其中也会对sharepoint内部网站进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!本文目录一览: 1、什么叫sharep......
2023-12-15 0 sharepoint网站功能管理
最近,有这么个需求,需要定时为SharePoint更新内容,所以,就想到了PowerShell命令和任务计划(Windows自带的功能,英文叫Task Schedule,在开始菜单里就能找到),然后,就配置了一下。配置成功......
2021-06-25 935 SharePoint配置PowerShell任务计划
今天给各位分享微软sharepoint面经的知识,其中也会对microsoft sharepoint web designer进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!本文目录一览: 1、......
2023-12-23 0 微软sharepoint面经