-
Notifications
You must be signed in to change notification settings - Fork 396
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Reporting an Issue or Missing Feature
We are attempting to functionally migrate data from one SharePoint Online site collection to another by technically recreating equivalent list items in the target site collection using PnP PowerShell.
During migration, when we try to preserve system-managed fields such as:
- Author
- Editor
- Created
- Modified
the cmdlet fails with the following error:
The specified user could not be found.
Architecture Context
Current (Source) Architecture
- All transactional and master data reside in a single site collection.
New (Target) Architecture
- One primary site collection acts as the user interface and hosts globally applicable master data.
- Market-specific subsites store market-level master data and transactional data.
- SPFx web parts are used to enforce market-based data segregation at the UI layer.
Migration Scenario
- We are migrating historical data from the old architecture to the new one.
- All required users, permissions, and market-level access configurations have been pre-provisioned in the target environment.
- Despite this, when explicitly setting system fields during item creation/update, the migration fails with a user resolution error.
Permissions Tested (App-Only)
We tested the migration using the following app-only permission configurations:
- Sites.FullControl.All + User.Read.All
- Sites.Selected (Microsoft Graph & SharePoint) with FullControl on both source and target site collections + User.Read.All
The issue occurs consistently under both permission models.
Expected behavior
The migration should allow preserving system-managed fields (Author, Editor, Created, Modified) when:
- The referenced users exist in the tenant
- The application has sufficient permissions to read users and write list items
Actual behavior
The cmdlet throws:
The specified user could not be found.
even though:
- Users exist in the tenant
- Users have access to the target site/subsite
- The app has FullControl and User.Read.All permissions
Steps to reproduce behavior
- Ensure all configurations are in place in target site collection including users and permissions.
- Create an item in a list in target site collection by reading values from source site collection using
Add-PnPListItem - Try to update item using below code
Set-PnPListItem -List "TargetList" -Identity $newItem.Id -UpdateType SystemUpdate -Connection $marketConnection -Values @{
"Created" = $oldItem.FieldValues["Created"];
"Modified" = $oldItem.FieldValues["Modified"];
"Author" = $oldItem.FieldValues["Author"].Id;
"Editor" = $oldItem.FieldValues["Editor"].Id;
}
What is the version of the Cmdlet module you are running?
3.1.0
Which operating system/environment are you running PnP PowerShell on?
- Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working