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.
  1. November 6th, 2019 at 22:56 | #1
  2. November 18th, 2019 at 18:42 | #2
  3. November 23rd, 2019 at 17:13 | #3
  4. November 28th, 2019 at 00:08 | #4
  5. November 28th, 2019 at 03:18 | #5
  6. November 28th, 2019 at 05:18 | #6
  7. November 28th, 2019 at 05:31 | #7
  8. December 11th, 2019 at 01:17 | #8
  9. December 11th, 2019 at 01:44 | #9
  10. December 15th, 2019 at 15:53 | #10
  11. December 22nd, 2019 at 23:28 | #11
  12. December 23rd, 2019 at 05:06 | #12
  13. December 23rd, 2019 at 13:19 | #13
  14. December 23rd, 2019 at 23:27 | #14
  15. December 25th, 2019 at 06:04 | #15
  16. December 25th, 2019 at 10:37 | #16
  17. December 25th, 2019 at 22:59 | #17
  18. December 26th, 2019 at 07:03 | #18
  19. December 27th, 2019 at 08:41 | #19
  20. December 28th, 2019 at 21:34 | #20
  21. December 29th, 2019 at 23:49 | #21
  22. January 1st, 2020 at 19:36 | #22
  23. January 8th, 2020 at 03:56 | #23
  24. January 8th, 2020 at 04:01 | #24
  25. January 8th, 2020 at 04:13 | #25
  26. January 8th, 2020 at 04:50 | #26
  27. January 8th, 2020 at 04:59 | #27
  28. January 8th, 2020 at 05:44 | #28
  29. January 9th, 2020 at 01:24 | #29
  30. January 9th, 2020 at 04:00 | #30
  31. January 11th, 2020 at 04:28 | #31
  32. January 19th, 2020 at 19:07 | #32
  33. January 20th, 2020 at 07:36 | #33
You must be logged in to post a comment.