Backup NTFS Permissions of folders

rookie_b
rookie_b used Ask the Experts™
on
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?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2017

Commented:

Author

Commented:
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.
Distinguished Expert 2017
Commented:
It does you write out the results from the get-ACL
You then use the output file as the input with as you noted -aclobject "oath to and the filename

Test it out on a test folder with a folder and couple of files

I find it helpful to test and see how things work.

Simply run the get-ACL testfolder
And you can see what the resulting output is.

You can also use icacls to do the same thing and then use icacls with the data as input to ...
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

Shaun VermaakSenior Consultant
Awarded 2017
Distinguished Expert 2018

Commented:

Author

Commented:
Thanks Shaun, this looks promising! I will review and test it and see how it goes.

Author

Commented:
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!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial