Windows permissions
Security descriptors in Windows are used to describe permissions in Windows. The security descriptor contains an Access Control List (ACL).
For example, an NTFS ACL is used to describe who or what can access which file or folder.
Individual rights in an ACL are described using a set of Access Control Entries (ACEs).
The FileSystem
and Registry
providers support Get-Acl
and Set-Acl
, which allow the different ACLs to be modified.
Working with permissions in PowerShell involves a mixture of PowerShell commands and .NET objects and methods.
Alternatives to .NET classes
The NtfsSecurity
module found in the PowerShell Gallery may be an easier alternative to the native methods discussed in this section.
While some values and classes differ between the different providers, many of the same concepts apply.
The following snippet creates a set of files and folders in C:\Temp
. These files and folders are used in the examples that follow:
New-Item C:\Temp\ACL...