Copy Permissions from One SharePoint Site to Another using PowerShell

Requirement: Copy permissions from one site to another in SharePoint!


If you want to copy one SharePoint site to another site, there are no OOTB ways! However, You can use PowerShell to copy permissions between sites. Here is my PowerShell script to copy site permissions.

copy permissions from one sharepoint site to another using powershell

Copy Permissions from one site to another using PowerShell:

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
#PowerShell Function to copy permissions from one site to another
Function Copy-SitePermissions()
 Try {
  #Set the Error Action
    $ErrorActionPreference = "Stop"
  #Get the Source and Target Webs
  $SourceWeb = Get-SPWeb $SourceWebURL
  $TargetWeb = Get-SPWeb $TargetWebURL
  #if permissions are Inherited in the target, Break it!
   #Reset the Inheritence in Target Web
   #Copy permissions from Source to Target Web
     $SourceWeb.RoleAssignments | foreach-object {
    Write-Host "Permissions copied from Source Site to the Target!" -f Green
 catch {
   Write-Host $_.Exception.Message -ForegroundColor Red
 finally {
  #Reset the Error Action to Default
  $ErrorActionPreference = "Continue"

#Call the function to copy Web permissions 
Copy-SitePermissions -SourceWebURL "" -TargetWebURL "" 

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

9 thoughts on “Copy Permissions from One SharePoint Site to Another using PowerShell

  • July 7, 2021 at 2:09 AM

    I got the following error: The term ‘Get-SPWeb’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    • September 9, 2021 at 1:55 PM

      This script is written for SharePoint On-premises and must be executed from any of the SharePoint server in the farm.

  • January 3, 2021 at 5:37 PM


    Is there any script available for SharePoint Online to perform this activity.

  • December 9, 2019 at 7:13 AM

    Hi Does this also copy the SharePoint Groups from the source or it just copies users and their permissions?

    E.g Managers …. Full Control or Name.Surname … Full Control?

    • December 10, 2019 at 9:20 AM

      This script copies all users and groups – that has permissions to source web to the target!

  • June 16, 2019 at 4:13 PM

    Hi, does this also work if lists have broken inheritance and custom permissions?

  • October 25, 2018 at 2:51 AM

    You check Inherit permission Source Web. If Inherit then you stop inheriting permission. Hope help you!

  • March 10, 2017 at 11:49 AM


    I am getting the following error on using the above code: Exception calling “Add” with “1” argument(s): “0x80070003”. please let me know, how to fix this?


Leave a Reply