PnP copy .pst in SharePoint site collection to a new library

Tagged: ,

Viewing 1 reply thread
  • Author
    • #1557601
      Member Points: 381
      Rank: 2

      We are dealing with SharePoint OnPrem / 2016 in this scenario.

      I have a library template located in Site Collection 1, and need to create a library in site collection 2 using this centrally located .pst file in Site Collection 1.

      Every example I’ve seen so far has the .pst in the same site collection, but our scenario the .pst will stay in site collection 1 so there’s one source of truth.

      Is this an option? Does the .pst have to be in the same site collection where the new library is created if using PnP?

      Please advise of any example where I could accomplish this.

      Connect-PnPOnline -Url https://OurSiteORIG -CurrentCredentials
      Get-PnPFile -Url /_catalogs/lt/TempLibrary_100Rows.stp -Path c:\temp -FileName TempLibrary_100Rows.stp -AsFile -Force

      #Now the .stp file is downloaded, upload it to destination and create library
      Connect-PnPOnline -Url https://OurSiteDest -CurrentCredentials
      Add-PnPFile -Path c:\temp\TempLibrary_100Rows.stp -Folder “_catalogs/lt”
      New-PnPList -Title “MyNewLibrary” -Template TempLibrary_100Rows -OnQuickLaunch


      Please advise of any example where I could accomplish this, as I’m getting the following error:

      New-PnPList : Cannot bind parameter ‘Template’. Cannot convert value “TempLibrary_100Rows” to type “Microsoft.SharePoint.Client.ListTemplateType”. Error: “Unable to
      match the identifier name TempLibrary_100Rows to a valid enumerator name. Specify one of the following enumerator names and try again:

    • #1557615
      Member Points: 381
      Rank: 2

      What about a simple copy library from one site collection to another…that’ll work for the moment?

      I’ve been searching for scripts, and nothing working so far.

      PnP seems like would be super concise option for this.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
© 4sysops 2006 - 2023


Please ask IT administration questions in the forums. Any other messages are welcome.


Log in with your credentials


Forgot your details?

Create Account