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.
#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!"
Navigate to “List Template” and see, we save list as template.
Save list as template sharepoint 2019 using powershell | #SharePoint2019, #SharePointListTemplate
Categories: powershell, powershell command, powershell script, sharepoint templates
You must be logged in to post a comment.