Gets the sharing permissions on a file/SMB share.
Get-FileSharePermission [-Name] <String> [[-Identity] <String>] [<CommonParameters>]
The Get-FileSharePermission
function uses WMI to get the sharing permission on a file/SMB share. It returns the permissions as a Carbon.Security.ShareAccessRule
object, which has the following properties:
Security.Principal.NTAccount
for the user/group who has permission.The ShareRights
are values from the Carbon.Security.ShareRights
enumeration. There are four values:
If the share doesn't exist, nothing is returned and an error is written.
Use the Identity
parameter to get a specific user/group's permissions. Wildcards are supported.
Get-FileSharePermission
was added in Carbon 2.0.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name | String | The share's name. |
true | false | |
Identity | String | Get permissions for a specific identity. Wildcards supported. |
false | false |
Carbon.Security.ShareAccessRule.
Get-FileSharePermission -Name 'Build'
Demonstrates how to get all the permissions on the Build
share.