Support
 
Phone Live Chat
 
Support
 
US: +1 888 720 9500
 
Intl: +1 925 924 9500
Aus: +1 800 631 268
UK: 0800 028 6590
CN: +86 400 660 8680

Direct Inward Dialing: +1 408 916 9393

 
 
 
 
 

How to export NTFS permissions to a CSV

Export NTFS permissions to a CSV file with Windows File Explorer and PowerShell by reading the access control list (ACL) of each folder with Get-Acl. This guide covers the steps, their limitations, and the ADManager Plus alternative.

 
  • File Explorer
  • PowerShell
  • ADManager Plus
  • Why ADManager Plus
  • Real-world use cases
  • FAQ
  • Troubleshooting
 

Steps to export NTFS permissions to a CSV using File Explorer

Prerequisites for exporting NTFS permissions to a CSV via File Explorer

  • Permissions: Read permissions on the folder allow you to view its security settings.
  • Tools: You need File Explorer on the file server or on any Windows computer that can reach the share.
  • Setup: Keep the folder path ready. For a network share, use the universal naming convention (UNC) path (for example, \FileServer\Share).

Steps to export NTFS permissions to a CSV using File Explorer

File Explorer displays the NTFS permissions of a folder but has no option to save them as a CSV file, so the steps below are only for viewing the permissions.

  1. Open File Explorer and go to the folder, or type its UNC path in the address bar.
  2. Right-click the folder and select Properties.
  3. Open the Security tab. The top box lists the users and groups with access. Select one to see its allowed and denied permissions below.
  4. Click Advanced to open Advanced Security Settings. The Permissions tab lists each entry with its type, principal, access level, inheritance source, and scope.
  5. Repeat the steps for every subfolder you need to review.

Limitations for exporting NTFS permissions to a CSV via File Explorer

  • Permissions can only be viewed on the screen, so the entries have to be copied by hand.
  • Each folder opens separately, which is impractical for a large folder tree.
  • icacls can save permissions to a text file in SDDL format, but that format is meant for restoring permissions and is not a CSV.

How to export NTFS permissions to a CSV using PowerShell

Prerequisites for exporting NTFS permissions to a CSV via PowerShell

  • Permissions: Use an account that can enumerate the required folder tree and read the security descriptors (READ_CONTROL) of the folders being scanned. Administrative privileges may be necessary in restricted environments but are not inherently required for every NTFS permissions export.
  • Tools: Use PowerShell 5.1 or PowerShell 7.
  • Setup: Create the folder that will hold the CSV file (for example, D:\Reports) and note the UNC path of the folder to scan.

Steps to export NTFS permissions to a CSV using PowerShell

  1. Open PowerShell with the account that has the required permissions.
  2. Set $RootPath to the path of the top folder and $OutFile to the location of the CSV file.
  3. Run the script. It uses Get-ChildItem to list the root folder and its subfolders, reads each ACL with Get-Acl, and writes one row per access control entry to the CSV file.
    $RootPath = "\\FileServer\Share"
    $OutFile = "D:\Reports\NTFS-Permissions-$(Get-Date -Format yyyyMMdd).csv"
    $Folders = @(Get-Item -LiteralPath $RootPath) + @(Get-ChildItem -LiteralPath $RootPath -Directory -Recurse -ErrorAction SilentlyContinue)
    $Folders | ForEach-Object {
        $FolderPath = $_.FullName
        (Get-Acl -LiteralPath $FolderPath).Access | Select-Object @{Name = "FolderPath"; Expression = { $FolderPath }}, IdentityReference, FileSystemRights, AccessControlType, IsInherited, InheritanceFlags, PropagationFlags
    } | Export-Csv -Path $OutFile -NoTypeInformation

Open the CSV file. Each row shows the folder path, the user or group (IdentityReference), the rights granted (FileSystemRights), whether the entry allows or denies access (AccessControlType), and whether it is inherited (IsInherited). The CSV lists the NTFS access control entries defined on each folder. It does not calculate the effective permissions of individual users.

Supported parameters: Get-Acl

Parameter Description
-Path Specifies the path of the file or folder with the security descriptor being retrieved
-LiteralPath Specifies the path exactly as typed, without wildcard interpretation
-InputObject Retrieves the security descriptor of an object that has no path
-Audit Includes the audit data (system ACL) of the resource in the output

Supported parameters: Get-ChildItem

Parameter Description
-Path Specifies the location to list
-LiteralPath Specifies the location exactly as typed, without wildcard interpretation
-Directory Returns folders only
-Recurse Returns items from the specified location and all its subfolders
-Depth Limits the number of subfolder levels returned when used with -Recurse

Supported parameters: Export-Csv

Parameter Description
-Path Specifies the location of the CSV file
-NoTypeInformation Omits the type information line from the file in PowerShell 5.1
-Append Adds rows to an existing CSV file instead of overwriting it
-Delimiter Specifies the character that separates the values
-Encoding Specifies the character encoding of the file

Limitations for exporting NTFS permissions to a CSV via PowerShell

  • The script has to be edited for every new root path and output location.
  • Get-Acl cannot perform recursion on its own, so Get-ChildItem has to supply the folder list.
  • Folders the account cannot read are skipped by Get-ChildItem without a warning, so the CSV can be incomplete.
  • The CSV lists the user or group named in each entry, but it does not expand group membership.
  • The script reads NTFS permissions only. Share permissions require separate cmdlets.

How to export NTFS permissions to a CSV using ADManager Plus

Prerequisites for exporting NTFS permissions to a CSV via ADManager Plus

  • Permissions: You need an ADManager Plus administrator account or a help desk technician role that enables you to generate NTFS reports.
  • Tools: You need ADManager Plus with the domain that hosts the file server added to it.
  • Setup: Keep the shared resource path ready (for example, \\file-servername\sharename\directory or \dfs-namespace\sharename\directory).

Steps to export NTFS permissions to a CSV using ADManager Plus

  1. Log in to ADManager Plus and go to Reports > NTFS & Security Reports > NTFS Reports > Permissions for Folders. The Permissions for Folders report lists the users and groups that have access to folders in a specified path.
  2. Select the domain from the Select Domain drop-down.
  3. Enter the shared resource path in the Shared resource path field. To report on more than one path, click the + icon and add the others.
  4. Use the Check for folder permissions up to drop-down to select how many folder levels to include (for example, All the subfolders).
  5. Click Refine Result if you want to show or exclude specific folders, objects, or permissions.
  6. Click Generate.
  7. Click Export As at the top of the report and select CSV. The same menu offers XLSX, HTML, and PDF, and the report can also be emailed via More > Send Mail.
ADManager Plus' Permissions for Folders report showing the Select Domain, Shared resource path, and folder level fields.
Generating the Permissions for Folders report in ADManager Plus.

How ADManager Plus streamlines exporting NTFS permissions to a CSV

Real-world use cases

Use case 1: Export file share (SMB) permissions to a CSV

This script lists every non-special share on the file server along with its share permissions and writes them to a CSV file:

PowerShell script that exports file share permissions to a CSV and its output
$OutFile = "D:\Reports\Share-Permissions.csv"
Get-SmbShare -Special $false | ForEach-Object {
    $Share = $_
    Get-SmbShareAccess -Name $Share.Name |
        Select-Object Name, @{Name = "Path"; Expression = { $Share.Path }},
        AccountName, AccessControlType, AccessRight } | Export-Csv -Path $OutFile -NoTypeInformation

To achieve this result in ADManager Plus:

  1. Go to Reports > NTFS & Security Reports > NTFS Reports > Shares in the Servers. The Shares in the Servers report lists the shares on a server with their share names, access control entry types, and permissions.
  2. Select the domain from the Select Domain drop-down.
  3. Click the + icon next to the Computers field and select the servers with the shares you want to list.
  4. Click Refine Result if you want to show or exclude specific folders, objects, or permissions.
  5. Click Generate.
  6. Click Export As and select CSV, or go to More > Send Mail to email the report.
ADManager Plus Shares in the Servers report listing share permissions

Use case 2: Schedule a recurring NTFS permissions export to a CSV

This script registers a weekly task that runs the export script from the PowerShell steps, saved as C:\Scripts\Export-NtfsPermissions.ps1:

PowerShell script that registers a weekly scheduled task for the NTFS permissions export
$Action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument '-NoProfile -File "C:\Scripts\Export-NtfsPermissions.ps1"'
$Trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Monday -At 2am
$Cred = Get-Credential -UserName "CORP\svc-ntfsreport" -Message "Account that runs the export"
Register-ScheduledTask -TaskName "NTFS Permissions Export" -Action $Action -Trigger $Trigger -User $Cred.UserName -Password $Cred.GetNetworkCredential().Password

To get the same result with ADManager Plus, use scheduled reports:

  1. Log in to ADManager Plus and open the Reports tab.
  2. Click Schedule Reports in the top-right corner, then select Standard Scheduler.
  3. Click + Create Schedule and enter a name and description in the Schedule Name and Description fields.
  4. Select the domain in the Select Domain section.
  5. In the Select Reports section, select NTFS Reports, select Permissions for Folders, and set the report options and the exported file name.
    ADManager Plus' Schedule Reports page with the schedule name, domain selection, and NTFS Reports listed under Report Type.
    Creating a schedule in ADManager Plus: Name it, select the domain, and select Permissions for Folders under NTFS Reports.
    The Permissions for Folders window opened from the scheduler, with the path, folder level, columns, and filters.
    The Permissions for Folders window in ADManager Plus with the Shared resource path, folder level, column selection, and Refine Result options.
  6. In the Schedule Frequency section, select Hourly, Daily, Weekly, Monthly, or Custom and set the execution time.
  7. In the Notification Settings section, select Custom Notification, select CSV from the Select the format of your choice drop-down, click Storage Path to set where the file is stored, and enter the recipients in the Email To field.
  8. Click Save, or click Save & Run to run the schedule once immediately.
The Schedule Frequency and Notification Settings sections in the Standard Scheduler, where you choose the export format and recipients.
The Schedule Frequency and Notification Settings sections with the report format drop-down and the Email To field.
Note:

ADManager Plus shows an alert if a mail server is not configured. Specify the server in the Email Server/SMS Gateway settings under Admin > General Settings > Server Settings before saving the schedule.

FAQ

Skip the recursion and pass the folder directly to Get-Acl, then export the access entries:

(Get-Acl -LiteralPath "\\FileServer\Share\Finance").Access | Select-Object IdentityReference, FileSystemRights, AccessControlType, IsInherited | Export-Csv -Path "D:\Reports\Finance-Permissions.csv" -NoTypeInformation

NTFS permissions are stored on the files and folders themselves and apply to both local and network access. Share permissions apply only to access through the network share. When both apply, the more restrictive of the two decides the access. ADManager Plus reports on both through its NTFS and share permissions reports.

Windows stores share permissions as binary security descriptors under HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares\Security. Exporting that key creates a REG file that cannot be read as a permissions list and is not a CSV. Use Get-SmbShare and Get-SmbShareAccess instead, as shown in Use case 1, or run the Shares in the Servers report in ADManager Plus.

When an account is deleted from Active Directory, its entry stays in the folder's ACL, and Windows can no longer resolve it to a name. You can revoke these entries with the file permissions management feature in ADManager Plus.

Yes. The Permissions for Folders report checks the specified path (or several paths added with the + icon) and the subfolders down to the folder level you select. The NTFS Reports help page describes each report and its options.

Troubleshooting

The account running the script cannot read the security settings of the folder. Run the script with an account that has Read permissions on the folder tree, such as a member of the file server's local Administrators group.

The path has a typo, or the share name is wrong. Mapped drive letters are also unavailable in an elevated PowerShell session, so use the full UNC path in $RootPath.

-ErrorAction SilentlyContinue hides the folders that Get-ChildItem cannot open. Remove it temporarily to see which folders fail, then run the script with an account that can read them.

Get-SmbShare and Get-SmbShareAccess belong to the SmbShare module. Run the script on the file server, or point the cmdlets at it with the -CimSession parameter.

Check the Last Run Result column in Task Scheduler. The usual causes are a changed or expired password for the account, missing permissions for the account to log in as a batch job, or no write access to the output folder.

ADManager Plus Trusted By

The one-stop solution to Active Directory Management and Reporting