How to export NTFS permission by cmd using icacls

Nguyễn Đăng Ngọc 1 Reputation point
2022-05-10T08:37:32.897+00:00

I dont want to export by powershell cause it is not exported exactly data (some users are lost)

Using Icacls by cmd is exported exactly that I have double-checked.

I tried but icacls export only folder or only one driver. It is also export the folder even it wasn't share.

Is there any one know how to export all shareholder from all driver (included C:\ D:\, etc,,,)

Thanks you

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,115 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,351 Reputation points
    2022-05-11T07:47:10.89+00:00

    Hi BrianNguyen-9575,

    You can use the icacls.exe tool to export/import current NTFS directory permissions. To get all ACLs for a specific folder (including sub-directories and files), and export them to a text file, run the following command:

    icacls g:\filename /save c:\backup\filename_ntfs_perms.txt /t /c

    Note. /t key is used to get ACLs for all subdirectories and files, /c allows to ignore access errors. By adding /q option, you can disable the display of information about successful access to the file system objects.

    Depending on the number of files and folders, the export of permissions can take quite a long time. After the command has been executed, the statistics on the number of successful or failed processing of files will be displayed.

    Open the file filename_ntfs_perms.txt using any text editor. As you can see, it contains the full list of files and folders in a directory, and each item has the current permissions specified in SDDL (Security Descriptor Definition Language) format.


    --If the reply is helpful, please Upvote and Accept as answer--

    1 person found this answer helpful.