How to Preserve SharePoint People or Group Fields with PnP Site Templates
Question details
Users need to retain the specific SharePoint group selection in People or Group fields when exporting and importing PnP site templates.

- Product
- SharePoint / PnP PowerShell
- Device & OS
- not provided
- Scenario
- Exporting and importing SharePoint site templates using Get-PnPSiteTemplate and Invoke-PnPSiteTemplate commands.
- Observed behavior
- People or Group field settings are lost during the transfer because SharePoint groups are tied to specific site permissions and do not transfer reliably between different sites.
Ensure you have PnP PowerShell installed, site collection administrator permissions on both the source and destination sites, and that the account running the script has adequate rights to modify fields.
Update the Template XML with the Destination Group ID
Manually create the required group on the destination site and update the XML template to map the People or Group field correctly.
Because SharePoint groups are created within site-specific permissions, they cannot be exported or imported directly between sites. The most reliable workaround is to establish the group on the new site beforehand and point your template to it.
Navigate to the destination SharePoint site and manually create a group with the exact same permissions and settings as the source site.
Open the newly created group in the SharePoint UI and extract its ID from the URL (look for 'MembershipGroupId'), or use the Get-PnPGroup command to find it.
Open your exported PnP XML template file, locate the People or Group field definition, and update the UserSelectionScope attribute with the destination group ID.

Parameterize the Group ID for Reusable Templates
Use template parameters to dynamically inject the correct Group ID during import, making the template reusable across multiple sites.
Update the Field Post-Import via PowerShell
If modifying the XML template is not feasible, update the field configuration after the site has been provisioned using PnP PowerShell commands.
Boost Your Team's Productivity with WPS Office
While you manage complex SharePoint permissions and PnP templates, streamline your daily document workflow with WPS Office. It provides a lightweight, comprehensive suite for creating, editing, and collaborating on documents with full Microsoft Office compatibility.
- 1. Visit the official WPS Website: Go to wps.com to download the latest version of WPS Office for your operating system.
- 2. Install the software: Run the downloaded installer and follow the on-screen instructions to complete the setup.
- 3. Open and edit your documents: Launch WPS Office to instantly open, edit, and collaborate on your Microsoft Office files without any formatting loss.

Frequently Asked Questions
Why don't SharePoint groups transfer with PnP site templates?
SharePoint groups are tightly coupled with site-specific permissions and unique object IDs. The PnP provisioning engine cannot reliably export or import them across different site collections, requiring manual or scripted recreation.
How do I find the Group ID in SharePoint?
You can find the Group ID by navigating to Site Permissions, clicking on the specific group, and looking at the page URL for the 'MembershipGroupId' parameter. Alternatively, you can run 'Get-PnPGroup' in PowerShell.
Can I automate the destination group creation process?
Yes. You can use the 'New-PnPGroup' PowerShell command to create the destination group and retrieve its ID automatically in your script right before calling 'Invoke-PnPSiteTemplate'.




