使用 Powershell 自动创建 Sharepoint 任务

发布于 2024-12-15 22:42:41 字数 396 浏览 2 评论 0原文

我的组织正在尝试新的流程来协调开发人员将其代码集成到我们的主分支中。现在它只是 Sharepoint 中的一个基本任务列表,但它似乎做得很好。然而,创建这些任务票证需要大量繁琐的体力劳动,我们正在寻求改进这一点。为此,我有两个问题。

1) 我已经查看了 Sharepoint 的 Powershell cmdlet 列表,但如果不是 Sharepoint 专家,我在自动任务创建方面没有看到任何明显的东西。可以这样做吗?或者这些 cmdlet 是否更多地用于管理(配置)目的而不是用于使用?

2)这是对共享点的可怕滥用吗?最终,我们只是尝试为要注册的任务创建一个集中位置,其中包含有关任务详细信息、任务所有者和完成状态的一些基本信息。如果有一些明显更好的方法来做到这一点,我会洗耳恭听,因为无论我们做什么,我们都可能重新发明一些轮子或另一个。

My organization is experimenting with new processes to coordinate developers as they integrate their code into our main branch. Right now it's just a basic task list in Sharepoint, but it seems to be doing the trick pretty well. However, there's a lot of tedious manual labor in the creation of those task tickets, and we're looking to improve this. To that end, I have two questions.

1) I've looked through the list of Powershell cmdlets for Sharepoint, but without being a Sharepoint wiz I don't see anything immediately obvious in terms of automated task creation. Can this be done, or are the cmdlets more for administrative (configuration) purposes rather than for usage?

2) Is this a horrible abuse of sharepoint? Ultimately we're just trying to create a centralized location for tasks to be registered with some basic information concerning task details, task owner, and completion status. If there's some obviously better way to do this I'm all ears since no matter what we do we're probably reinventing some wheel or another.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

山色无中 2024-12-22 22:42:41

在 Powershell 中为 Sharepoint 创建任务就像将项目添加到列表一样简单。因此,此类脚本的基本步骤是:获取网络、获取任务列表、添加项目、填写属性、更新项目。

这段代码应该可以工作:

$w = get-spweb http://localhost/subweb
$l = $w.Lists['Tasks'] # use display name to index lists collection
$newitem = $l.AddItem()
$newitem['Title'] = 'Task for Peter'
$newitem['Body'] = 'Description of the task'
$newitem['DueDate'] = (get-date).AddDays(5)
$newitem['AssignedTo'] = $userId
$newitem.Update()

但这意味着,您在共享点服务器计算机上运行 PS 脚本。基本上可以针对本地共享点运行共享点 cmdlet。
也可以远程运行这些 cmdlet,但这需要双方设置 WinRM 服务,并且不是基本任务...

Task creation in powershell for Sharepoint is as easy as adding item to list. So the basic steps for such script would be: get web, get task list, add item, fill in properties, update item.

This code should work:

$w = get-spweb http://localhost/subweb
$l = $w.Lists['Tasks'] # use display name to index lists collection
$newitem = $l.AddItem()
$newitem['Title'] = 'Task for Peter'
$newitem['Body'] = 'Description of the task'
$newitem['DueDate'] = (get-date).AddDays(5)
$newitem['AssignedTo'] = $userId
$newitem.Update()

But this would mean, you run your PS script on sharepoint server machine. Basically it is possible to run sharepoint cmdlet against local sharepoint.
It is also possible to run those cmdlets remotely, but that needs setting of WinRM service on both sides and is not basic task...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文