get-acl powershell command

Get-Acl | Taking on PowerShell one cmdlet at a time | Weekly Blog

Share this post:

This is a part of an on-going blog series written by Adam Gordon. Each week, Adam will walk you through a PowerShell command, showing you when and how to use each one. This week, Adam covers Get-Acl.

When to use Get-Acl

Anytime you need to get the security descriptor for a resource, such as a file or registry key.

How to use Get-Acl

Get the security descriptor of a specified directory or file:

Get-Acl “C:\Windows” | FL

This command gets the security descriptor of the “C:\Windows” directory and uses the FL alias to output into a formatted list.

Get-Acl1

 

Get the security descriptor of a specified registry key or subkey:

Get-Acl -Path HKLM:\System\CurrentControlSet\Control | Format-List

This command uses the Get-Acl cmdlet to get the security descriptor of the Control subkey (HKLM\SYSTEM\CurrentControlSet\Control) of the registry.

The Path parameter specifies the Control subkey. The pipeline operator (|) passes the security descriptor that Get-Acl gets to the Format-List command, which formats the properties of the security descriptor as a list so that they are easy to read.

Get-Acl2 windows powershell commands

Need PowerShell training? Check out ITProTV’s PowerShell online IT training courses.

Leave a Reply

Your email address will not be published. Required fields are marked *