I'm copying PnP provisioning template with PowerShell using Get-PnPSiteTemplate command.

I need to copy all site permissions but I don't need to add users into it. Which properties for Get-PnPSiteTemplate command should I use?

1 Answer 1


With regards to site security, there doesn't appear to be a parameter you can set when calling Get-PnPSiteTemplate to not include users.

You can however remove the user entries from the XML template that is generated. Inside the <pnp:Security> XML node, you will find role assignments for the site (listed using the user's Active Directory IDs). Simply remove the user role assignments you do not want.

Additionally, if there are lists with unique permissions, you will find another <pnp:Security> node inside the <pnp:ListInstance> node. Again, you can remove whichever user role assignments you do not want.

  • Thank you so much
    – Ann
    Sep 15, 2022 at 7:51

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.