Powershell - Export permissions for folder and share?

I need to export all the share and folder level permission on one of my windows 2008 file servers. I have tried the command below and it give me all the folder and file level permissions.

Get-ChildItem "X:\Share" -recurse | Get-Acl | export-csv c:\djk\share_folder_permission.csv

I dont want file level permissions, only share and folder level.  Can you help?

 

 

May 14th, 2010 5:40pm

Try

Get-ChildItem "X:\Share" -recurse | Get-Acl -Exclude *.* | export-csv c:\djk\share_folder_permission.csv

or

Get-ChildItem "X:\Share" -recurse -Exclude *.* | Get-Acl | export-csv c:\djk\share_folder_permissi

Free Windows Admin Tool Kit Click here and download it now
May 14th, 2010 5:58pm

Try the following commands:

For files and folders use

> Get-ChildItem -Recurse "dir\subdir" | Get-Ace | Export-Csv dir-temp.csv


For folders only

> Get-ChildItem -Recurse "dir\subdir" | where {$_.Attributes -eq 'Directory'} | Get-Ace | Export-Csv dir-temp.csv

 

PS: before use the commands above you should have the module "NTFSSecurity" in the path of your user.

Example:

C:\Users\my_name\Documents\WindowsPowerShell\Modules\NTFSSecurity

Then use the following commands to use it:

> Get-Module -ListAvailable

> Import-Module NTFSSecurity

December 10th, 2013 3:17pm

This worked for me! Thank you very much.
Free Windows Admin Tool Kit Click here and download it now
July 28th, 2014 6:25pm

Its good
February 2nd, 2015 5:44pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics