When i am trying to do a bulk import of files using PNP i am unable to retain the created by Value (The files are in a local file share) .I am able to set all the other values (Created,Editor,Modified) but not Author.These are the various approaches i have tried so far .Can you please provide any suggestion

Add-PnPFile -Path "C:\temp\test.txt" -Folder "Shared Documents"  -Values @{Created="7/24/2019";Author="[email protected]";Editor="[email protected]";Modified="02/23/2012"}
Add-PnPFile -Path "C:\temp\test.txt" -Folder "Shared Documents"  -Values @{Created="7/24/2019";Author=14}
Set-PnPListItem -List "Shared Documents" -Identity 11 -Values @{"Title" = "Test Title"; Author="[email protected]"}

1 Answer 1


You need to pass the Author and Editor's userId in the double-quotes.

For example, Author="14";Editor="15"

Here is the complete working code.

Add-PnPFile -Path "C:\temp\test.txt" -Folder "Shared Documents"  -Values @{Created="7/24/2019";Author="14";Editor="15"}

enter image description here

  • Thanks a lot :)
    – Anil
    Dec 18, 2019 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.