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.

Advertisements

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
Advertisements
#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!"
Save list as template sharepoint 2019 powershell-2
Save list as template sharepoint 2019 powershell-2
Advertisements

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

Save list as template sharepoint 2019 powershell -3
List Template
Advertisements

Save list as template sharepoint 2019 using powershell | #SharePoint2019, #SharePointListTemplate

Save list as template sharepoint 2019 using powershell | #SharePoint2019, #SharePointListTemplate


Categories: powershell, powershell command, powershell script, sharepoint templates

Tags: , , , , , , , , ,

Discover more from SharePointTechnicalSupport

Subscribe now to keep reading and get access to the full archive.

Continue reading