I’m lovin’ the NTFSSecurity module more and more!
In my first attempt I looked up the NTFS Access on folders that were explicit using Get-ChildItem2 -Recurse. In hindsight this is definitely a WET solution!
Turns out NTFSSecurity module has a cmdlet for getting NTFS Access aptly named:
So there’s no need to reinvent the wheel, think DRY!!!
The code then becomes quiet simple:
Get-ChildItem2 $Path -Recurse -Directory | Get-NTFSAccess -ExcludeInherited
That’s all there is to it! No muss no fuss!!!
Here’s how to get an overview of all the cmdlets in the module with syntax:
Get-Command -Module NTFSSecurity -CommandType Cmdlet -Syntax | Out-GridView
There’s even a Get-NTFSOrphanedAccess cmdlet! Talk about being spoiled!!!
Good watching out for the community raandree! Your code rocks!!!