Export File Share Permissions to CSV

Marcus Wong Theen Nam 1,146 Reputation points
2021-07-21T07:19:29.913+00:00

Hi,

I have came across several articles from microsoft or internet but all of them are script that help to export the NTFS permissions of shared folder. I would like to export out the Share permissions of those shared folder instead of NTFS permission to CSV file. I know that I could export out the registry key for shared folders but is there any commands or script that could export it out to csv file?

Thank you.

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2021-07-21T08:36:47.51+00:00

    Hi,

    You can use the Get-Smbshare cmdlet to get the security descriptor of the share.

    $share = "myshare"  
    $file = "C:\temp\share.csv"  
    Get-SmbShare -Name $share | Select-Object -Property Name,SecurityDescriptor | Export-csv -NoTypeInformation -Path $file  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.