Forum Discussion

SanjeevB's avatar
SanjeevB
Copper Contributor
Nov 21, 2024

How to update the Comment Author field programmatically?

I'm migrating a SharePoint (2019) OnPrem Site Collection to SPO. I have numerous Site pages in OnPrem that users have commented on and I would like to migrate the Site Pages, the Comments and the Comment Author to SPO.

Using PnP PowerShell, I am able migrate the Site Pages and the Comments. I'm using a REST API POST method to create the comments in SPO.  However, I am unable to to set the Author name of the comment in SPO.  As it is, the migrated comments all fall under my name...as that is the login my script used. 

Is there a way to programmatically set the Author name in SPO.

More information...

  • I've re-created the OnPrem users in SPO
  • I've migrated the OnPrem SitePages meta data to SP lists in SPO.
  • I then loop through these SP lists to dynamically create Site Pages and Comments.

 

 

 

 

No RepliesBe the first to reply

Resources