My PowerShell

Windows Powershell scripts, examples, tips, docs …

Export (backup) NTFS permissions

Use the following PowerShell script to backup NTFS permissions:

Permissions Only one folder (no subfolders):

Get-Childitem -path \\server\path\folder | Where-Object {$_.PSIsContainer} | Get-ACL | Select-Object Path -ExpandProperty Access | Export-CSV c:\tmp\ntfs.csv

Permissions With subfolders (-recurse):

Get-Childitem -path \\server\path\folder -recurse | Where-Object {$_.PSIsContainer} | Get-ACL| Select-Object Path -ExpandProperty Access | Export-CSV c:\tmp\ntfs_subfolders.csv

 

Tagged as:

Leave a Response