NTFSSecurity: Remove-NTFSAccess cannot remove an ACE with the GenericAll AccessRights
Get-NTFSAccess -Path 'c:\mypath' -Account 'creator owner' | Remove-NTFSAccess
Results in the following error:
Remove-NTFSAccess : The value '269484032' is not valid for this usage of the type FileSystemRights.
Parameter name: fileSystemRights
+ CategoryInfo : WriteError: (c:\mypath:String) [Remove-NTFSAccess], ArgumentOutO fRangeException
+ FullyQualifiedErrorId : RemoveAceError,NTFSSecurity.RemoveAccess
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 16 (8 by maintainers)
Following up on my previous comment, I found another directory with a similar ACE.
This time I tried Giving myself GenericalAll via Add-NTFSAccess. What I found was that instead of AccessRights “GenericAll”, I had received Access Rights “Synchronize, GenericAll”, Further I found that I could remove those rights with
remove-ntfsaccess
So I though, “what if I try giving the user with GenericAll right, the same rights again?” Will they get that Synchronize right?Well, lo and behold, they do!! They end up with
And now you can easily remove that ACE
So I think we have a WORKAROUND
EDIT: Yes, I realize that this could be an expensive operation depending on the number of files and folders in a directory tree. Let me know what you think!
Still broken.
It happens when I try to remove the Everyone ACE when it has these rights.
Account Access Rights Applies to Type IsInherited InheritedFrom
Everyone GenericAll SubfoldersAndFilesOnly Allow False
Late to the party but I ran into this with trying to remove invalid SIDS from Shares. Seems if the AccessRights are GenericAll this issue comes up.
Get-NTFSOrphanedAccess -Path $UserShare | Remove-NTFSAccess