Skip to content

Get‑NTFSAccessRule

raandree edited this page Sep 6, 2026 · 1 revision

SYNOPSIS

Gets NTFS access rules for files and directories.

SYNTAX

Path (Default)

Get-NTFSAccessRule [[-Path] <String[]>] [-Account <String[]>] [-ExcludeInherited] [-ExcludeExplicit]
 [-ThrottleLimit <Int32>] [-Orphaned] [<CommonParameters>]

LiteralPath

Get-NTFSAccessRule -LiteralPath <String[]> [-Account <String[]>] [-ExcludeInherited] [-ExcludeExplicit]
 [-ThrottleLimit <Int32>] [-Orphaned] [<CommonParameters>]

DESCRIPTION

Returns structured access-rule objects for each filesystem path. Rules can be filtered by account and by whether they are explicit or inherited. InheritedFrom identifies the original ancestor reported by the Windows inheritance-source API. It is empty for explicit rules or when Windows cannot identify an inherited ancestor. The output can be piped to other module commands. A junction, a symbolic link, or a volume mount point carries its own descriptor and is reported as itself, not as its destination.

EXAMPLES

EXAMPLE 1

Get-ChildItem -LiteralPath C:\Data | Get-NTFSAccessRule -ExcludeInherited

Gets explicit access rules for every child item in C:\Data.

PARAMETERS

-Account

Limits output to one or more account names or SID strings.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ExcludeExplicit

Omits access rules that are explicitly assigned to the item.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ExcludeInherited

Omits access rules inherited from a parent directory.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-LiteralPath

One or more filesystem paths used exactly as supplied. FileSystem objects bind to this parameter through their PSPath property.

Type: String[]
Parameter Sets: LiteralPath
Aliases: PSPath

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Orphaned

Returns only rules whose security identifier cannot be translated to an account name.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Path

One or more filesystem paths. Wildcards are expanded by the FileSystem provider, and path strings can be supplied through the pipeline.

Type: String[]
Parameter Sets: Path
Aliases: FullName

Required: False
Position: 1
Default value: .
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: True

-ThrottleLimit

Limits concurrently processed canonical paths. One requests deterministic sequential execution.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: [Math]::Max(1, [Math]::Min(8, [Environment]::ProcessorCount))
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.String

System.IO.FileSystemInfo

OUTPUTS

WindowsAccessControl.AccessRule

NOTES

RELATED LINKS

Home

Commands

DSC resources

Clone this wiki locally