Skip to content
Solar Account.
Education & Software

How to Get Permissions on a Folder with PowerShell

To get permissions on a folder with PowerShell, the primary command is the Get-Acl cmdlet. By running Get-Acl -Path "C:\YourFolder", you retrieve the Access Control List. To view detailed, readable rules including user names and specific rights, use the comman...

How to Get Permissions on a Folder with PowerShell

To get permissions on a folder with PowerShell, the primary command is the Get-Acl cmdlet. By running Get-Acl -Path "C:\YourFolder", you retrieve the Access Control List. To view detailed, readable rules including user names and specific rights, use the command: (Get-Acl -Path "C:\YourFolder").Access | Select-Object IdentityReference, FileSystemRights, AccessControlType.

Contents

Managing file system security is a cornerstone of Windows administration. While the Windows File Explorer GUI provides a visual way to check permissions via the "Security" tab, it becomes inefficient when auditing hundreds of folders or automating security reports. PowerShell offers a robust, scalable alternative that allows system administrators to query, filter, and export permission data with precision.

As of 2026, PowerShell 7.x remains the standard for cross-platform task automation, but the core cmdlets for handling NTFS (New Technology File System) permissions remain consistent with legacy Windows PowerShell 5.1. Understanding how to navigate the Access Control List (ACL) object is essential for maintaining a secure and compliant IT environment.

Understanding the Access Control List (ACL) Structure

Before executing commands, it is vital to understand what PowerShell is actually retrieving. When you query a folder's permissions, you are interacting with a Security Descriptor. This descriptor contains several critical components that define who owns the object and who can interact with it.

The most relevant part for most administrators is the DACL (Discretionary Access Control List). The DACL consists of multiple ACEs (Access Control Entries). Each ACE defines a specific relationship between a "Trustee" (a user, group, or computer) and a set of "Rights" (Read, Write, Full Control).

Extract File And Folders With Specified Permissions - XULC

PowerShell represents these entries through the Access property of the ACL object. When you run a raw Get-Acl command, PowerShell often returns the owner and a condensed string of permissions. To see the granular details—such as whether a permission is inherited or if it applies to subfolders—you must "expand" the Access property. This distinction is the most common hurdle for beginners who find the default output of Get-Acl unhelpful.

Using Get-Acl for Basic Permission Retrieval

The Get-Acl cmdlet is the starting point for any permission-related task. At its simplest level, you provide a path to a directory, and PowerShell returns the security descriptor for that specific object.

Get-Acl -Path "D:\Data\Finance"

The output of this basic command shows the Path, Owner, and Access. However, the "Access" column is often truncated or displayed as a list of System.Security.AccessControl.FileSystemAccessRule objects. To make this data actionable, you should pipe the output to Format-List or, more effectively, access the property directly.

Deep Diving into the Access Property

To see exactly who has what rights, you need to look inside the Access property. This returns an array of objects, where each object represents one entry in the Security tab of the folder properties.

$Acl = Get-Acl -Path "C:\Marketing" $Acl.Access

By viewing the .Access property, you will see several columns:

  • IdentityReference: The user or group name (e.g., BUILTIN\Administrators or DOMAIN\MarketingGroup).
  • FileSystemRights: The specific permissions held (e.g., ReadAndExecute, Modify, FullControl).
  • AccessControlType: Whether the permission is Allow or Deny.
  • IsInherited: A boolean (True/False) indicating if the permission comes from a parent folder.
  • InheritanceFlags: Defines if the permission propagates to subfolders or files.

Advanced Filtering and Formatting

In a professional environment, you rarely need to see every single permission. You might only be looking for "Deny" rules or checking which permissions are explicitly set rather than inherited.

Filtering for Specific Users

If you need to verify the permissions of a specific group, such as "Domain Users," you can use the Where-Object cmdlet to filter the results. This is particularly useful during security audits to ensure that sensitive folders haven't been accidentally shared with broad groups.

(Get-Acl -Path "C:\HR_Records").Access | Where-Object { $_.IdentityReference -like "*Domain Users*" }

Identifying Non-Inherited Permissions

Inheritance is a powerful feature of NTFS, but "explicit" permissions (those set directly on the folder) are often where security risks reside. To find only the permissions that have been manually added to a folder, filter by the IsInherited property:

(Get-Acl -Path "C:\SharedData").Access | Where-Object { $_.IsInherited -eq $false }

This command helps administrators identify "orphaned" permissions or manual overrides that might deviate from the organization's standard security hierarchy.

Getting Permissions for Subfolders Recursively

One significant limitation of the Get-Acl cmdlet is that it does not have a built-in -Recurse parameter. To get permissions for a folder and all its subdirectories, you must combine it with Get-ChildItem.

This approach is essential for identifying "permission creep," where nested folders have different security settings than their parents.

$FolderPath = "D:\Projects" $AllFolders = Get-ChildItem -Path $FolderPath -Recurse -Directory foreach ($Folder in $AllFolders) { $Acl = Get-Acl -Path $Folder.FullName $Acl.Access | Select-Object @{Name="Path"; Expression={$Folder.FullName}}, IdentityReference, FileSystemRights }

In this script, we first gather all directories. Then, we loop through each one, retrieve the ACL, and create a custom object that includes the folder's full path. This provides a comprehensive map of the entire directory structure's security.

Exporting Permissions to CSV for Auditing

For compliance and reporting, technical output in the console is rarely sufficient. Stakeholders often require reports in spreadsheet format. PowerShell makes it easy to export permission data to a CSV file.

When exporting, it is best to flatten the object so that each permission entry becomes a single row in the spreadsheet.

$RootPath = "C:\Shares" Get-ChildItem -Path $RootPath -Recurse -Directory | ForEach-Object { $Path = $_.FullName (Get-Acl -Path $Path).Access | Select-Object ` @{Name="FolderPath"; Expression={$Path}}, ` IdentityReference, ` FileSystemRights, ` AccessControlType, ` IsInherited } | Export-Csv -Path "C:\Reports\FolderPermissions_2026.csv" -NoTypeInformation

This script generates a detailed audit log that can be opened in Microsoft Excel. It includes the folder path, the user/group, the specific rights, and whether the permission was inherited.

Comparison of Permission Retrieval Methods

There are several ways to view permissions in Windows. Depending on your needs—speed, readability, or automation—you might choose different tools.

Method Best For Pros Cons
Get-Acl (Native) Quick checks and basic scripting. Built-in, no installation required, very fast for single folders. Output requires manual formatting; no native recursion.
icacls.exe Legacy support and speed. Extremely fast; comes with Windows; supports recursion natively. Output is plain text and difficult to parse with scripts.
NTFSSecurity Module Complex audits and management. Readable output; purpose-built for NTFS; handles long paths. Requires downloading from the PowerShell Gallery.
File Explorer GUI Visual confirmation for one folder. Easy to use; no coding knowledge required. Not scalable; cannot export data easily.

Handling Long File Paths and Errors

In 2026, while Windows has largely mitigated the 260-character path limit through registry settings, many legacy scripts and environments still struggle with deep directory structures. If Get-Acl encounters a path that is too long, it may throw an error.

To handle these instances, ensure you are using the Unicode prefix \\?\ for local paths in your variables, or use PowerShell 7, which handles long paths more gracefully. Additionally, always wrap your permission queries in a try-catch block when running against large network shares to prevent the script from crashing when it hits a folder it doesn't have access to (Access Denied).

try { $Acl = Get-Acl -Path $Folder.FullName -ErrorAction Stop } catch { Write-Warning "Could not access permissions for $($Folder.FullName): $($_.Exception.Message)" }

Frequently Asked Questions

How do I see permissions for a single user only?

To see permissions for a single user, use the Where-Object filter on the IdentityReference property. For example: (Get-Acl -Path "C:\Folder").Access | Where-Object { $_.IdentityReference -eq "DOMAIN\jdoe" }. This will filter the list to show only the entries specifically assigned to that user account.

Why does Get-Acl show "ReadAndExecute" instead of "Read"?

NTFS permissions are often grouped. "ReadAndExecute" is a standard permission set that includes Read, List Folder Contents, and Read & Execute. PowerShell displays the underlying FileSystemRights enumeration, which reflects these bundled rights. If you see a long string of numbers instead of words, it means the permission is a "Special Permission" that doesn't map to a standard name.

Can I check permissions on a remote computer with PowerShell?

Yes, you can use PowerShell Remoting. Run Invoke-Command -ComputerName "Server01" -ScriptBlock { Get-Acl -Path "C:\SharedFolder" }. This executes the command locally on the remote server and returns the results to your console. Ensure that WinRM is enabled on the target machine.

How do I check if a folder is inheriting permissions?

Check the AreAccessRulesProtected property of the ACL object. If this property is $true, inheritance is disabled (blocked). If it is $false, inheritance is enabled. You can check it with: (Get-Acl -Path "C:\Folder").AreAccessRulesProtected.

What is the difference between Get-Acl and icacls?

Get-Acl is a PowerShell cmdlet that returns objects, which are easy to manipulate and filter. icacls is a legacy command-line utility that returns text. While icacls is often faster for massive recursive changes, Get-Acl is superior for creating reports and performing complex logic within a script.

How can I see the owner of a folder?

The owner is a top-level property of the object returned by Get-Acl. Simply run (Get-Acl -Path "C:\Folder").Owner. This will return the security identifier (SID) or the friendly name of the user or group that currently owns the directory.

Next Actions for Secure Permission Management

After mastering how to retrieve permissions, the next logical step is learning how to modify them. The Set-Acl cmdlet is used to apply changes, but it can be dangerous if used incorrectly, as it replaces the entire ACL rather than merging changes.

For those performing frequent audits, consider installing the NTFSSecurity module from the PowerShell Gallery. It provides a much more intuitive set of commands, such as Get-NTFSAccess, which simplifies the output and makes recursive permission gathering significantly faster than using native Get-Acl loops. Always perform permission audits on a regular schedule—at least quarterly—to ensure that "permission bloating" does not occur as employees change roles within your organization.

Written by

Matthew Bennett

Technology & Business Software Editor