Tag Archives: Save list as template sharepoint 2019 powershell

Save list as template sharepoint 2019 powershell

Most of the cases end user or site owner who actually own the sharepoint site for production server, create list using out of box UI to create sharepoint list. There are certain cases where requirement is to save list as template and create another list using the saved template. Here i will share how to Save list as template sharepoint 2019 powershell. Creating powershell is very fast, easy, less performance issues compared to UI method.

I have a custom sharepoint list “Name: Report 2019”. The number of list items crossed the limit of listview threshold 5000. You got a request to create another list of similar template without including content. This case Save list as template sharepoint 2019 powershell would be helpful. Please find the script below.

Save list as template sharepoint 2019 powershell
#Configuration parameters
$WebURL="http://win-7uqhlrcrq7g:40331/sites/SpTechSupport/"
$ListName="Report 2019"
$TemplateName="Report 2019 Template"
$TemplateFileName="Report2019Template"
$TemplateDescription="Report 2019 List Template"
$SaveData = $true

#Get the Web and List objects
$Web = Get-SPWeb $WebURL
$List = $Web.Lists[$ListName]

#Save List as Template
$List.SaveAsTemplate($TemplateFileName, $TemplateName, $TemplateDescription, $SaveData)
Write-Host "List Saved as Template!"
Advertisements
Advertisements
Save list as template sharepoint 2019 powershell-2
Save list as template sharepoint 2019 powershell-2

Navigate to “List Template” and see, we save list as template.

Save list as template sharepoint 2019 powershell -3
Advertisements