Lists all the shared folder permissions or NTFS permissions (PowerShell)


This PowerShell script illustrates how to list all the shared folder permissions and NTFS permissions.


In many cases, users want to check many share folders permission one by one. If we can use the script to list these share folders permission, it will really useful.


Step 1: Click Start, type powershell in the search box on the Start Menu, right-click the Windows PowerShell icon, and then click Run Windows PowerShell as administrator. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.

Step2: Start the PowerShell Console with administrator. To run the script in the Windows PowerShell Console, type the command< Script Path> at the Windows PowerShell Console.

For example, you can type the command Get-Help C:\Script\ListAllSharedFolderPermission.ps1 -Full to display the entire help file for this function, such as the syntax, parameters, or examples. This is shown in the following figure.

 The script has three parameters:

For example, type the following commands,

$cre = Get-Credential “WIN-FJ6FH2787QS\Administrator”

C:\Script\ListAllSharedFolderPermission.ps1 -ComputerName "WIN-FJ6FH2787QS" as shown below:

This example lists all of share permission of shared folder on the WIN-FJ6FH2787QS remote computer.

Here are some code snippets for your references.

    $SharedNTFSSecs = Get-WmiObject-Class Win32_LogicalFileSecuritySetting ` 
    -Filter"Path='$SharedFolderPath'"-ComputerName $ComputerName-Credential $Credential 
    $SharedNTFSSecs = Get-WmiObject-Class Win32_LogicalFileSecuritySetting ` 
    -Filter"Path='$SharedFolderPath'"-ComputerName $ComputerName 


Windows PowerShell 2.0

Additional Resources


Related forum threads: