Create list from custom template in SharePoint with PowerShell

This examples shows how to create new lists from custom list templates in SharePoint using PowerShell and CSOM. Custom list templates are STP-files uploaded to the List Template Gallery on the site. This should work both on-premises (2013/2016) and Online (Office 365).

Note: This example uses commands from the Office Dev PnP PowerShell library, ex. “Connect-PnPContext”. I recommend using this library for working this PowerShell and SharePoint (both Online and On-Premises).

3 thoughts on “Create list from custom template in SharePoint with PowerShell”

  1. Hi,
    Thanks for this post.It is useful for creating the list with custom list template.
    I have tried to create a list with my custom list using a template.In my case the list is created successfully but without any column names and data.
    only title column is showing and other columns from my custom list template is not created and no data also.
    Please help me to create a list with same template.


  2. Try the following instead…

    $ListCreation = New-Object Microsoft.SharePoint.Client.ListCreationInformation
    $ListCreation.Title = $ListName

    ## Add Line Below ##
    $ListInfo.ListTemplate = $ListTemplate

    ## Optional / Good Practice ##
    #$ListCreation.TemplateFeatureId = $ListTemplate.FeatureId
    ## Optional / Good Practice ##
    #$ListCreation.TemplateType = $ListTemplate.ListTemplateTypeKind

    (See ListCreationInformation properties


    1. Hi, there is something easier to do :
      You can replace THIS
      [ if ($ListTemplate -eq $null)
      Throw [System.Exception] “Template not found”

      $ListCreation = New-Object Microsoft.SharePoint.Client.ListCreationInformation
      $ListCreation.Title = $ListName
      $ListCreation.TemplateFeatureId = $ListTemplate.FeatureId
      $ListCreation.TemplateType = $ListTemplate.ListTemplateTypeKind

      Execute-PnPQuery ]

      BY THIS cmdlet PnP :
      New-PnPList -Title $ListName -Url $ListName -Template $ListTemplate.ListTemplateTypeKind
      (I just tested and this works fine !)

      Title and Url can be different of course.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s