Create a Task in SharePoint Task List using PowerShell

PowerShell Script to Create a New Task in SharePoint Task List:

This blog post will show you how to create a task in SharePoint Task List using PowerShell.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Configuration Parameters

#Get web and List objects
$Web = Get-SPWeb $WebURL
$TaskList = $Web.Lists[$TaskListName]

$NewTaskItem = $TaskList.AddItem()

#Set value for Task list columns
$NewTaskItem["Title"] = "New Task"
$NewTaskItem["StartDate"]= (Get-Date).ToShortDateString()
$NewTaskItem["DueDate"] =(Get-Date).AddDays(7)
$NewTaskItem["Status"]="Not Started"
$NewTaskItem["Priority"]= "(1) High"


Write-host "New Task Item Created Successfully!"

and here is the new task created in SharePoint 2016 task list:

create new task item in Task list of SharePoint using PowerShell

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

Leave a Reply

Your email address will not be published. Required fields are marked *