Get-Permission

Gets the permissions (access control rules) for a path.

Syntax

Get-Permission [-Path] <String> [[-Identity] <String>] [-Inherited] [<CommonParameters>]

Description

Permissions for a specific identity can also be returned. Access control entries are for a path's discretionary access control list.

To return inherited permissions, use the Inherited switch. Otherwise, only non-inherited (i.e. explicit) permissions are returned.

Parameters

Name Type Description Required? Pipeline Input Default Value
Path String The path whose permissions (i.e. access control rules) to return. true false
Identity String The identity whose permissiosn (i.e. access control rules) to return. false false
Inherited SwitchParameter Return inherited permissions in addition to explicit permissions. false false

Return Values

System.Security.AccessControl.AccessRule.

EXAMPLE 1

Get-Permission -Path C:\Windows

Returns System.Security.AccessControl.FileSystemAccessRule objects for all the non-inherited rules on C:\windows.

EXAMPLE 2

Get-Permission -Path hklm:\Software -Inherited

Returns System.Security.AccessControl.RegistryAccessRule objects for all the inherited and non-inherited rules on hklm:\software.

EXAMPLE 3

Get-Permission -Path C:\Windows -Idenity Administrators

Returns System.Security.AccessControl.FileSystemAccessRule objects for all the Administrators' rules on C:\windows.