Guest User

Untitled

a guest
Jan 16th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # Copy permissions and add recursively via Powershell
  2.  
  3. Usefull when you need to apply the same permissions to all subfolders and items and get error trying to do it via the GUI in Windows.
  4.  
  5. Run Powershell as admin.
  6.  
  7. ```powershell
  8. $acl = Get-Acl "C:\Path-To-Object-To-Copy-Permissions-From"
  9. $items = Get-ChildItem "D:\Parent-Folder-Containing-All-Objects-To-Apply-Permissions-To" -Recurse
  10. foreach ($i in $items) { Set-Acl -Path $i.FullName -AclObject $acl }
  11. ```
Add Comment
Please, Sign In to add comment