Powershell Script to get the NTFS permissions of a folder


' Provide the folder path as highlighted below
' Output will be an permissions.csv file


# Include only folders from the root path
Get-ChildItem "D:\Test" -Recurse | ?{ $_.PsIsContainer } | %{
  $Path = $_.FullName

  (Get-Acl $Path).Access | Select-Object `
    @{n='Path1';e={ $Path }}, IdentityReference, `
    FileSystemRights, IsInherited
} | Export-CSV "Permissions.csv"



***Share your comments about this post***

No comments:

Post a Comment