Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-NTFSAccess does not actually contain Initial output #49

Open
TheFitITGuy opened this issue Apr 16, 2019 · 3 comments
Open

Get-NTFSAccess does not actually contain Initial output #49

TheFitITGuy opened this issue Apr 16, 2019 · 3 comments
Assignees
Labels
Enhancement An enhancement to the current feature set

Comments

@TheFitITGuy
Copy link

When trying to access the array of information from the output. It shows that the "Access Rights", "Applies to" are not actually available but only for view. Upon further investigation I found that the "Access Rights" is actually "AccessRights" but Applies to is not actually within the output. Which makes trying to use the information to correct ntfs problems an issue.

image

@mwtrigg
Copy link

mwtrigg commented Apr 16, 2019

"Applies to" is just a simpler representation of "InheritanceFlags" and "PropagationFlags", so while you can't directly filter on the "Applies to" computed value, you can filter on the appropriate combination of the flags. A breakdown of how these flags work together to create the several options can be found here:

https://stackoverflow.com/questions/3282656/setting-inheritance-and-propagation-flags-with-set-acl-and-powershell#8390274

Admittedly, it would be nice if the simplified/computed value was available to filter, but that sounds more like a feature request than a bug or issue.

@TheFitITGuy
Copy link
Author

Agreed. Its a nice to have but it is available in Set-NTFSAccess . I just thought I would point it out

@raandree
Copy link
Owner

Thanks @mwtrigg for your input which is all correct.

There is a method that helps doing the conversion. This code can also be used in a Where-Object filter.

$pf = [System.Security.AccessControl.PropagationFlags]::None
$if = [System.Security.AccessControl.InheritanceFlags]::None

[Security2.FileSystemSecurity2]::ConvertToFileSystemFlags([Security2.ApplyTo]::SubfoldersAndFilesOnlyOneLevel, [ref]$if, [ref]$pf)

$if
$pf

@raandree raandree self-assigned this Jul 10, 2019
@raandree raandree added the Enhancement An enhancement to the current feature set label Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement An enhancement to the current feature set
Projects
None yet
Development

No branches or pull requests

3 participants