rookie_b
asked on
Backup NTFS Permissions of folders
How can I back up NTFS permissions of folders and sub-folders? I was thinking of using get-acl, but how do I store that output permanently to something that can later be referenced as an -AclObject, should I want to restore them using set-acl?
ASKER
Thanks for getting back to me, Arnold!
I have looked at the link but it doesn't tell me how to actually save the acl as something I can use at a later point. The moment I close the window those variables and the ACLs saved in them will be gone.
I have looked at the link but it doesn't tell me how to actually save the acl as something I can use at a later point. The moment I close the window those variables and the ACLs saved in them will be gone.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I would use SetACL.exe list feature
https://helgeklein.com/setacl/documentation/command-line-version-setacl-exe/#list
https://helgeklein.com/setacl/documentation/command-line-version-setacl-exe/#list
ASKER
Thanks Shaun, this looks promising! I will review and test it and see how it goes.
ASKER
Thank you for giving me the options and setting me on the right path.In the end I using get-acl and psobject to format the output into a csv, which now can then be used as an input to a set-acl script. The advantage of this is that I get I don't lose the variable when I close powershell, and also has the added benefit that I can review and change the permissions in excel before I set them.
Thanks you for all your help!
Thanks you for all your help!
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-acl?view=powershell-6
The set-ACL includes an examples you might find useful.