Checking File and Folder Permissions

Get-Acl is a convenient Cmdlet to expose NTFS file and folder settings. For example, to get a list of ownerships for a folder content, do this:

Dir | Get-Acl

To find out which "Identities" (Users or groups) have specific permissions granted, access the Access property of each Acl to see the actual permissions, then group by IdentityReference:

dir | Get-Acl | ForEach-Object { $_.Access  } | Group-Object IdentityReference

Posted Mar 05 2009, 08:00 AM by ps1

Comments

seawheels1 wrote re: Checking File and Folder Permissions
on 03-13-2009 8:46 PM

This one liner in not working for me in powershell v2 ctp3

Get-Acl : Attempted to perform an unauthorized operation.

At line:1 char:14

+ dir | Get-Acl <<<<  | ForEach-Object { $_.Access  } | Group-Object IdentityReference

   + CategoryInfo          : NotSpecified: (:) [Get-Acl], UnauthorizedAccessException

   + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetAclCommand

seawheels1 wrote re: Checking File and Folder Permissions
on 03-13-2009 9:21 PM

I get it now, it was a permissions issue which is why it threw the error, sorry for being stupid

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.