Last active
August 21, 2017 13:37
-
-
Save RobsonAutomator/6f214b2163de29da48513b1bf305f2da to your computer and use it in GitHub Desktop.
Copies a Sitecore item access rights from one identity to another identity.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Copies an item access rights from one identity to another identity. | |
.EXAMPLE | |
Copy-ItemAcl -FromIdentity 'SUPER\ROBSONAUTOMATOR' -ToIdentity 'LAZY\ONE' -Path "/sitecore/content/Home" | |
.Author | |
Robert Senktas | |
#> | |
function Copy-ItemAcl{ | |
[CmdletBinding()] | |
param( | |
# FromIdentity User name including domain | |
[Parameter(Mandatory=$true)] | |
[string]$FromIdentity, | |
# ToIdentity User name including domain | |
[Parameter(Mandatory=$true)] | |
[string]$ToIdentity, | |
[Parameter()] | |
# Path A path to the Sitecore item | |
[string]$Path | |
) | |
$acls = Get-ItemAcl -Path $Path -Identity $FromIdentity | |
$acls | % {Add-ItemAcl -Path $Path -Identity $ToIdentity -AccessRight $_.AccessRight -SecurityPermission $_.SecurityPermission -PropagationType $_.PropagationType } | |
#Get-ItemAcl -Path $Path -Identity $ToIdentity | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment