Hi @H Risbud,
To extract file properties from a SharePoint Online document library using PnP PowerShell, you can use the "Get-PnPListItem.
Here's an example of how to extract the file attributes you mentioned:
# Connect to SharePoint Online
Connect-PnPOnline -Url "https://your-domain.sharepoint.com/sites/your-site"
# Get all files from the document library
$files = Get-PnPListItem -List "Documents"
# Iterate through each file and retrieve the properties
foreach ($file in $files) {
$fileName = $file.FieldValues["FileLeafRef"]
$fileUrl = $file.FieldValues["FileRef"]
$createdBy = $file.FieldValues["Author"]
$createdDate = $file.FieldValues["Created"]
# Output the file properties
Write-Output "File Name: $fileName"
Write-Output "File URL: $fileUrl"
Write-Output "Created By: $createdBy"
Write-Output "Created Date: $createdDate"
}
# Disconnect from SharePoint Online
Disconnect-PnPOnline
Here is result:


Note:
But for the page number of PDF, it belongs to some functions provided by the third party (Adobe Acrobat) to process the page number of PDF file.
Sorry, we cannot provide relevant test functions and services here, please understand
Regarding this content, I can provide relevant ideas to help you. To use COM objects to process PDF files in Windows, you need to install an appropriate PDF processing library and register it on the computer.
A commonly used PDF processing library is Adobe Acrobat.
Visit the official Adobe website, and download and install the latest version of Adobe Acrobat software.
During the installation process, make sure to select related components such as "Adobe PDF iFilter" and "Adobe PDF Library Files" for installation.
After the installation is complete, open Command Prompt (CMD) to run as administrator.
Navigate to the "bin" folder of your Adobe Acrobat installation directory. For example, if installed in the default location, the path might be: "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat".
5
In a command prompt, run the following command to register the COM component:
regsvr32.exe "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Acrobat.tlb"
Please adjust the path in the command according to the actual installation path.
After completing the above steps, you should be able to use COM objects in PowerShell scripts to manipulate PDF files, including operations such as getting page numbers.
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.
Best Regards
Cheng Feng