Set-SmbPathAcl

Set-SmbPathAcl

Sets the ACL for the file system folder to match the ACL used by an SMB share.

Syntaxe

Parameter Set: Default
Set-SmbPathAcl [-ShareName] <String> [[-ScopeName] <String> ] [ <CommonParameters>]

Description détaillée

The Set-SmbPathAcl cmdlet sets the access control list (ACL) for the file system folder to match the ACL for the server message block (SMB) share. The cmdlet sets the ACL to match the SMB share itself. This action simplifies the configuration of NTFS or ReFS file system permissions by copying the SMB share permissions.

Paramètres

-ScopeName<String>

Specifies the scope name of the SMB share. The cmdlet sets the ACL for the scope that you specify.

Alias

none

Obligatoire ?

false

Position ?

2

Valeur par défaut

none

Accepter l’entrée de pipeline ?

false

Accepter les caractères génériques ?

false

-ShareName<String>

Specifies the name of the SMB share. The cmdlet sets the ACL on the file system folder to the ACL used by the SMB share that you specify.

Alias

none

Obligatoire ?

true

Position ?

1

Valeur par défaut

none

Accepter l’entrée de pipeline ?

false

Accepter les caractères génériques ?

false

<CommonParameters>

Cette applet de commande prend en charge les paramètres courants : -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer et -OutVariable. Pour plus d’informations, consultez about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entrées

Le type d’entrée correspond au type des objets que vous pouvez transmettre à l’applet de commande.

Sorties

Le type de sortie est le type des objets émis par l’applet de commande.

Remarques

  • The previous syntax for the same task, ((Get-SmbShare –Name <ShareName> ).PresetPathACL | Set-Acl), continues to work with newer versions of the Windows Server operating system, but the new syntax is much simpler and therefore recommended.

Exemples

Example 1: Set the SMB path ACL by share name

This command sets the ACL on the file system folder used by the Share01 share to match the ACL of the share.

PS C:\> Set-SmbPathAcl -ShareName "Share01"

Example 2: Set the SMB path ACL by share name and scope name

This command sets the ACL on the file system folder used by the Share01 share on the SOFS01 scope to match the ACL of the share.

PS C:\> Set-SmbPathAcl -ShareName "Share01" -ScopeName "SOFS01"