Home > PowerShell > Retrieve File Permissions using Get-Acl with PowerShell

Retrieve File Permissions using Get-Acl with PowerShell

Retrieving the owner and permissions of a file, folders and even registry keys is a breeze with PowerShell’s Get-Acl cmdlet. Let’s try checking to see who has access to to the C:\Documents and Settings\Administrator folder.

Get-Acl "C:\Documents and Settings\Administrator"

Now this return everything that I would expect it to, but I prefer the Format-List view, so let’s check the permissions on the the file C:\Windows\clock.avi and output it in a list view.

Get-Acl "C:\Windows\clock.avi" | Format-List

Ok, now I did say we could check the permissions of a registry key, so let’s go for it…

1
Get-Acl HKLM:\Software\Microsoft

Now if you just want to find out the owner of the file you could pull back just that value

1
Get-Acl "C:\Windows\clock.avi" | Select Owner
  1. No comments yet.
Comment pages
1 2 3 4 385
  1. March 24th, 2020 at 15:09 | #1
  2. March 24th, 2020 at 15:26 | #2
  3. March 25th, 2020 at 03:26 | #3
  4. March 25th, 2020 at 16:18 | #4
  5. March 25th, 2020 at 18:16 | #5
  6. March 26th, 2020 at 05:33 | #6
  7. March 26th, 2020 at 06:49 | #7
  8. March 26th, 2020 at 11:49 | #8
  9. March 26th, 2020 at 15:18 | #9
  10. March 27th, 2020 at 00:02 | #10
You must be logged in to post a comment.