< Back

Get-CFileSharePermission

Sun Jan 12, 2020 9:40 pm

NAME Get-CFileSharePermission



SYNOPSIS

Gets the sharing permissions on a file/SMB share.





SYNTAX

Get-CFileSharePermission [-Name] <String> [[-Identity] <String>] [<CommonParameters>]





DESCRIPTION

The `Get-CFileSharePermission` 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:



* ShareRights: the rights the user/group has on the share.

* IdentityReference: an `Security.Principal.NTAccount` for the user/group who has permission.

* AccessControlType: the type of access control being granted: Allow or Deny.



The `ShareRights` are values from the `Carbon.Security.ShareRights` enumeration. There are four values:



* Read

* Change

* FullControl

* Synchronize



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-CFileSharePermission` was added in Carbon 2.0.





PARAMETERS

-Name <String>

The share's name.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Identity <String>

Get permissions for a specific identity. Wildcards supported.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Carbon.Security.ShareAccessRule





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-CFileSharePermission -Name 'Build'



Demonstrates how to get all the permissions on the `Build` share.











RELATED LINKS

Get-CFileShare

Install-CFileShare

Test-CFileShare

Uninstall-CFileShare