Sunday, 8 January 2017

Exporting NTFS folder permission report to excel or csv file.

Or, How to export shared folders permission of a file server to excel?
Or, PowerShell script/command to export local or shared folders permission to excel or csv file.

Descriptions: Very commonly, an administrator is asked for exporting NTFS folders permission for audit and internal compliance management purpose. There are lots of freeware and paid tools available with certain terms and limitations.

Here in this article, we are going to see how we can export folders permissions without any third party freeware or paid tools.

Prerequisites:
1. Make sure you have appropriate administrative rights on the shared folders of which you want to               export permissions.
2. Have at least basic knowledge of Windows PowerShell (preferably Get-XXXXX command).
    NTFS security script folder downloaded from MS Technet 
3. Full permission on your local system’s directory
    C:\Users\techies_sphere\Documents\WindowsPowerShell\Modules (replace techies_sphere with               your logged in user name).


IMP Note: In some cases, you might not be able to see the full folder path, Most probably, WindowsPowerShell and Modules folder. To complete the folder path structure, you can create missing folders manually as well. Finally, the folder path should look like ‘C:\Users\techies_sphere\Documents\WindowsPowerShell\Modules’.

Steps:
Go to the folder path C:\Users\techies_sphere\Documents\WindowsPowerShell\Modules.
Copy the complete NTFSSecurity folder inside Modules folder









Verify if you have all these files inside the NTFSSecurity Folder.













Navigate to the folder for which you want to export permissions. I am my case in below example screenshot, I want to export folder permissions of folder MyData-Test-1.











To prepare your command, Replace folder path and csv export location as per your requirement in below command:
Get-NTFSAccess -Path \\192.168.161.10\TestSharedFolder\MyData-Test-1 | Export-Csv C:\TestFiles\permissions.csv

Open Windows PowerShell as Administrator

















Run the command you prepared in above step






That’s it. You can now get your permissions.csv file from your csv export location. In my case, its C:\TestFiles\

Cheers, please write me back if you have any query of feedback on this…

No comments:

Post a Comment