none
Copy/Export or Backup Folder Permissions RRS feed

  • Question

  • Hi,

    I have to move a folder from one volume to another. I.E. \\Server\OldShare to \\Server\NewShare but need to retain the NTFS security and share permissions from one location to another. I know I can break out a pencil and pad and start cataloguing but would like to script it for process documentation and consistency. I've used icacls to initially set the permissions, but they tend to change over time. I'd like to use PowerShell and have tried.

    Get-ChildItem -Path "D:\OldFolder" -Force -Recurse | ?{$_.Mode -like "d*"} | Sort FullName | Get-Acl | Select path,owner,accesstostring,group | Export-Csv 'c:\shared_folder_permissions.csv'

    The syntax works but it generates a huge CSV file that covers each file in the directory, which is nice, but I'm just looking for the folder (Share + NTFS) permissions and looking to inheritance to cover child objects.

    Thoughts? Thanks!



    Jason

    Tuesday, October 10, 2017 8:21 PM

Answers

  • The only  way to do that is with ICACLS.


    \_(ツ)_/

    • Marked as answer by N74JW Wednesday, October 11, 2017 12:38 AM
    Tuesday, October 10, 2017 11:14 PM
    Moderator

All replies