Copy List Items from One list to another using pnp Powershell

In this article we will see how to copy list items from one list to another using PNP PowerShell:

In the below code, just replace the source site url and destination site url. Also, update the columns internal names. I have used -UseWebLogin to login to sites using a web browser, you can also pass credentials manually as shown at the bottom of post.

    Connect-PnPOnline -Url "" -UseWebLogin
    $listName = "AssetTypeMaster"  
    $fields = "AssetType", "Description", "AseetTypeDescription"  
    $listItems = Get-PnPListItem -List $listName -Fields $fields # Write lists item to other list 
    Connect-PnPOnline -Url "" -UseWebLogin  
foreach($listItem in $listItems) { $itemValues = @{ "AssetType" = $listItem["AssetType"]; "Description" = $listItem["Description"]; "AseetTypeDescription" = $listItem["AseetTypeDescription"] } Add-PnPListItem -List $listName -Values $itemValues }

You can use credentials as well as shown below:


$username = "userid1"  
$userPassword = "password1"  
$secpasswd = ConvertTo-SecureString $userPassword -AsPlainText -Force  
$mycreds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $secpasswd 


$username1 = "userid2"  
$userPassword1 = "passw0rd2"  
$secpasswd1 = ConvertTo-SecureString $userPassword1 -AsPlainText -Force  
$mycreds1 = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username1, $secpasswd1
Powershell using passing credentials:
$sourceWebUrl = ""  
$destinationWebUrl = ""

#Connect to source site  
Connect-PnPOnline -Url $sourceWebUrl -Credentials $mycreds;      
$listName = "AssetTypeMaster"  
$fields = "AssetType", "Description", "AseetTypeDescription"  
#Retrieves items  
$listItems = Get-PnPListItem -List $listName -Fields $fields 

#Write lists item to other list  
#Connect to destination site
Connect-PnPOnline -Url $destinationWebUrl -Credentials $mycreds1;  
foreach($listItem in $listItems) {  
    $itemValues = @{  
        "AssetType" = $listItem["AssetType"];  
        "Description" = $listItem["Description"];  
        "AseetTypeDescription" = $listItem["AseetTypeDescription"]  
    Add-PnPListItem -List $listName -Values $itemValues  

Post a Comment


  1. Thanks for the code. However, I have a question: Should it be "AseetTypeDescription" or "AssetTypeDescription" for destination?

    1. It is just a spelling mistake. You need to use the internal name of the columns.