Share via

Windows 2012 Server, Share Permissions

NightWing2099 11 Reputation points
2021-06-21T16:28:48.817+00:00

I want to get a list of shared folders and security permissions in this server directory e:\serverfolder

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other
0 comments No comments

3 answers

Sort by: Most helpful
  1. ErazerMe 46 Reputation points
    2021-06-22T16:07:13.793+00:00

    Hey,

    The previous answers face the NTFS-Permission.

    For checking the SMB-Permission of the according SMB-Share you can try this:

    $Directory = 'E:\\ServerFolder'
    Get-SmbShare | Where {$_.Path -match $Directory} | Get-SmbShareAccess
    

    Was this answer helpful?


  2. Anonymous
    2021-06-22T05:36:24.83+00:00

    Hi,

    You may try this

    $directory = 'e:\\serverfolder'  
    Get-SmbShare | Where { $_.Path -match $directory } | Get-Acl | fl  
    

    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.

    Was this answer helpful?

    0 comments No comments

  3. Rich Matheisen 48,116 Reputation points
    2021-06-21T18:38:32.13+00:00

    The get the shares on the machine: Get-SmbShare

    To recursively get the permissions on directories and files:

    get-childitem e:\serverfolder -recurse | 
        get-acl | 
            Format-List  # or some other way of displaying the data
    

    Was this answer helpful?

    0 comments No comments

Your answer

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