Using Get-Acl
I am trying to get the access rights on a folder. The thing is, for some groups I get a number instead of a access type. Example below:
get-acl "C:\TestFolder" | % {$_.access}
FileSystemRights : -536805376
AccessControlType : Allow
IdentityReference : TestDomain\Support
IsInherited : False
InheritanceFlags : ObjectInherit
PropagationFlags : InheritOnly
Is there any way to translate this number back to its name?
The value of the
FileSystemRights
property is an unsigned 32-bit integer, where each bit represents a particular access permission. Most of the permissions are listed in theWin32_ACE
class documentation, except for the "generic" permissions (bits 28-31) and the right to access SACLs (bit 23). More details can be found here and here.If you want to break down an ACE access mask into its specific access rights (vulgo "extended permissions") you could do something like this:
The simple permissions
FullControl
,Modify
,ReadAndExecute
etc. are just specific combinations of these extended permissions.ReadAndExecute
for instance is a combination of the following extended permissions:ReadData/ListDirectory
Execute/Traverse
ReadAttributes
ReadExtendedAttributes
ReadControl
so the access mask for
ReadAndExecute
would have the value 131241.If you want the result to be a combination of simple permission and the remaining extended permissions, you could do something like this:
Quick and dirty tanslation:
268435456 - FullControl
-536805376 - Modify, Synchronize
-1610612736 - ReadAndExecute, Synchronize
If you want to learn about the translation process this was the best i could find at the moment: Link