How to Back Up and Restore NTFS and Share Permissions Using ICACLS

To save:


D:\>icacls D:\acltest /save perms.txt /t /c
processed file: D:\acltest
processed file: D:\acltest\Screens
processed file: D:\acltest\Trooper.txt
processed file: D:\acltest\web-core.jar
processed file: D:\acltest\Screens\adminGroup_perms.JPG
processed file: D:\acltest\Screens\admin_perms.JPG
processed file: D:\acltest\Screens\AdvSecuritySetting_AllowAdminGroup_perms
processed file: D:\acltest\Screens\AdvSecuritySetting_AllowAdminGroup_perms
processed file: D:\acltest\Screens\AdvSecuritySetting_AllowAdmin_perms_1.JPG
processed file: D:\acltest\Screens\AdvSecuritySetting_AllowAdmin_perms_2.JPG
processed file: D:\acltest\Screens\AdvSecuritySetting_AllowEveryone_perms_1.
processed file: D:\acltest\Screens\AdvSecuritySetting_AllowEveryone_perms_2.
processed file: D:\acltest\Screens\AdvSecuritySetting_DenyAdmin_perms.JPG
processed file: D:\acltest\Screens\AdvSecuritySetting_noInherit_perms.JPG
processed file: D:\acltest\Screens\EffectivePerm_Everyone_1.JPG
processed file: D:\acltest\Screens\EffectivePerm_Everyone_2.JPG
processed file: D:\acltest\Screens\EVERYONE_PERMS.JPG
processed file: D:\acltest\Screens\MappedFolder_Perms.JPG
Successfully processed 18 files; Failed processing 0 files

The /T switch allows it to get subfolder permissions too. The /C switch allows it to continue even if errors are encountered (although errors will still be displayed).

D:\>icacls D:\ /restore perms.txt 
processed file: D:\acltest
processed file: D:\acltest\Screens
processed file: D:\acltest\Trooper.txt
processed file: D:\acltest\web-core.jar
processed file: D:\acltest\Screens\adminGroup_perms.JPG
processed file: D:\acltest\Screens\admin_perms.JPG
processed file: D:\acltest\Screens\AdvSecuritySetting_AllowAdminGroup_perms
processed file: D:\acltest\Screens\AdvSecuritySetting_AllowAdminGroup_perms
processed file: D:\acltest\Screens\AdvSecuritySetting_AllowAdmin_perms_1.JPG
processed file: D:\acltest\Screens\AdvSecuritySetting_AllowAdmin_perms_2.JPG
processed file: D:\acltest\Screens\AdvSecuritySetting_AllowEveryone_perms_1.
processed file: D:\acltest\Screens\AdvSecuritySetting_AllowEveryone_perms_2.
processed file: D:\acltest\Screens\AdvSecuritySetting_DenyAdmin_perms.JPG
processed file: D:\acltest\Screens\AdvSecuritySetting_noInherit_perms.JPG
processed file: D:\acltest\Screens\EffectivePerm_Everyone_1.JPG
processed file: D:\acltest\Screens\EffectivePerm_Everyone_2.JPG
processed file: D:\acltest\Screens\EVERYONE_PERMS.JPG
processed file: D:\acltest\Screens\MappedFolder_Perms.JPG
Successfully processed 18 files; Failed processing 0 files

NOTE: In the command to save the permissions, I specified the target folder D:\acltest, but when I restored them, I specified just D:\ as the target.


Comments

Popular posts from this blog

Scan FC LUN's in RHEL/CentOS

CEPH bluestore using ceph-ansible

Start wildfly service with standalone-full.xml