
Hi @john john ,
According to my research and testing, if you want to get items from larger lists with more than 5000 items, you should use PageSize
to handle larger lists in batches ,please try to use the following PowerShell script:
#Parameter
$SiteURL = "https://xxxx.sharepoint.com/sites/xxx"
$ListName= "xxx"
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL
#Get all list items from list in batches
$ListItems = Get-PnPFolderItem -List $ListName -PageSize 500
Write-host "Total Number of List Items:" $($ListItems.Count)
#Loop through each Item
ForEach($Item in $ListItems)
{
Write-Host "Id :" $Item["ID"]
Write-Host "Title :" $Item["Title"]
}
More information for reference: SharePoint Online: Get List Items from Large Lists ( >5000 Items) using PowerShell without List View Threshold Exceeded Error
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.