How to modify the SharePoint Created By value using PnP PowerShell

Whenever you create a list item or a document in SharePoint, the platform automatically adds the information of the user to the Created By column.

Once the file or item is added to the platform, there is no way to change the value of this column through the UI, however it is possible to do it using PnP PowerShell and that’s what I’m explaining in this article.

Modify SharePoint created by column

Why changing the Created By column in SharePoint

You might be thinking why something like this is important if SharePoint does not allow it to be made through the interface but there are a few situations where it will make sense to have the creator of the item to be changed.

One of the scenarios where I find this useful, is to change the author of SharePoint News Links that are published automatically in SharePoint, using this approach I’m able to match the SharePoint user with the real author of the article even with them being published into different platforms.

Modify the Author of an item in SharePoint

Before we jump into the execution of the PowerShell script there are three things you will need to modify the creator of an item:

  • The item ID, this information is not visible by default in the list but you can get it by making the ID column visible as illustrated in the following image
    Modify SharePoint created by column
  • The list or library name where the item is located
  • The email of the user who will become the new creator

In order to accomplish the steps described in this article you must install the latest version of the PnP PowerShell module, more information about how to do it can be found here.

With all the required information at hand, you are now ready to start changing the creator of items by doing the following:

  1. Open the PowerShell command line
  2. Execute the following cmdlet to connect to the SharePoint site collection where the list or library is located
    Connect-PnPOnline -url https://conoso.sharepoint.com
  3. Execute the script below, changing the values for the $listItemID, $listName and the $userEmail
    $listItemID = 1
    $listName = "Tours"
    $userEmail = "franciscapeixoto@handsontek.net" 
    Set-PnPListItem -List $listName -Identity $listItemID -Values @{ 
    	"Author"=$userEmail;
    } 
    
  4. Wait for the execution of the script, if all works as expected the result will be similar to the image below
    Modify SharePoint created by column

Keep in mind that after changing the author of the page, the value in the Modified By column, used to store the person who last modified the item will show the name of the user who executed the script.


No comments yet

Leave a Reply


I've been working with Microsoft Technologies over the last ten years, mainly focused on creating collaboration and productivity solutions that drive the adoption of Microsoft Modern Workplace.

%d bloggers like this: