November 23rd, 2014

PowerTip: Use PowerShell to Find If Folder Inherits from Parent

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to determine if an NTFS folder inherits from its parent folder.

Hey, Scripting Guy! Question How can I use Windows PowerShell to determine if an NTFS folder inherits from its parent folder?

Hey, Scripting Guy! Answer Use the Get-NTFSAccessInheritance cmdlet provided by the NTFSSecurity module, for example:

Get-NTFSAccessInheritance -Path C:\Windows

Or if you want to query multiple folders:

dir -Recurse | Get-NTFSAccessInheritance | Where-Object { -not $_.InheritanceEnabled }

Category
Scripting

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

1 comment

Discussion is closed. Login to edit/delete existing comments.

  • Michael McNally

    >Get-NTFSAccessInheritance
    Get-NTFSAccessinheritance : The term ‘Get-NTFSAccessinheritance’ is not recognized as the name of a cmdlet, function,
    script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
    correct and try again.

    >get-module ntfssecurity
    ModuleType Version Name ExportedCommands
    ———- ——- —- —————-
    Script 4.2.6 NTFSSecurity {Add-NTFSAccess, Add-NTFSAudit, Clear-NTFSAccess, Clear-NTFSAud…

    ??