Created
December 8, 2020 21:40
-
-
Save kevincdurand1/446aae404435fd248b1973bdcdecebcd to your computer and use it in GitHub Desktop.
Get NTFS File Permissions Using PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $FolderPath = Get-ChildItem -Directory -Path "C:\temp\" -Recurse -Force | |
| $Output = @() | |
| ForEach ($Folder in $FolderPath) { | |
| $Acl = Get-Acl -Path $Folder.FullName | |
| ForEach ($Access in $Acl.Access) { | |
| $Properties = [ordered]@{'Folder Name'=$Folder.FullName;'Group/User'=$Access.IdentityReference;'Permissions'=$Access.FileSystemRights;'Inherited'=$Access.IsInherited} | |
| $Output += New-Object -TypeName PSObject -Property $Properties | |
| } | |
| } | |
| $Output | Out-GridView |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment