PowerShell Logo Small

Grant-SmbShareAccess



This is the built-in help made by Microsoft for the command 'Grant-SmbShareAccess', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Adds an allow access control entry (ACE) for a trustee to the security descriptor of the Server Message Block (SMB) share.

SYNTAX


Grant-SmbShareAccess [-AccessRight <ShareAccessRight>] [-AccountName <String[]>] [-AsJob [<SwitchParameter>]] [-CimSession <CimSession[]>]
[-Force [<SwitchParameter>]] [-ThrottleLimit <Int32>] -InputObject <CimInstance[]> [-Confirm [<SwitchParameter>]] [-WhatIf
[<SwitchParameter>]] [<CommonParameters>]
Grant-SmbShareAccess [-Name] <String[]> [[-ScopeName] <String[]>] [-AccessRight <ShareAccessRight>] [-AccountName <String[]>] [-AsJob
[<SwitchParameter>]] [-CimSession <CimSession[]>] [-Force [<SwitchParameter>]] [-ThrottleLimit <Int32>] [-Confirm [<SwitchParameter>]]
[-WhatIf [<SwitchParameter>]] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Grant-SmbShareAccess cmdlet adds an allow access control entry (ACE) for a trustee to a security descriptor of the Server Message Block
(SMB) share.



<

RELATED LINKS

Block-SmbShareAccess
Get-SmbShareAccess
Revoke-SmbShareAccess
Unblock-SmbShareAccess

REMARKS

<

Examples


Example 1

PS C:\> Grant-SmbShareAccess -Name VMFiles -AccountName Contoso\Contoso-HV2$ -AccessRight Full
Confirm
Are you sure you want to perform this action?
Performing operation 'Modify' on Target 'Contoso-SO,VMFiles'.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y

Name ScopeName AccountName AccessControlType AccessRight
---- --------- ----------- ----------------- -----------
VMFiles Contoso-SO Contoso\Administrator Allow Full
VMFiles Contoso-SO Contoso\Contoso-HV1$ Allow Full
VMFiles Contoso-SO Contoso\Contoso-HV2$ Allow Full



This example adds an allow ACE for a trustee to the security descriptor of the SMB share named VMFiles for the account named
Contoso\Contoso-HV2$.




Example 2

PS C:\> Grant-SmbShareAccess -Name VMFiles -AccountName "Contoso\Domain Admins" -AccessRight Change -Force

Name ScopeName AccountName AccessControlType AccessRight
---- --------- ----------- ----------------- -----------
VMFiles Contoso-SO Contoso\Administrator Allow Full
VMFiles Contoso-SO Contoso\Contoso-HV1$ Allow Full
VMFiles Contoso-SO Contoso\Contoso-HV2$ Allow Full
VMFiles Contoso-SO Contoso\Domain Admins Allow Change



This example adds an allow ACE for a trustee to the security descriptor of the SMB share named VMFiles for the account named
Contoso\Contoso-HV2$ without user confirmation.