Skip to main content
SnapCenter 5.0 cmdlets

New-SdSMBShare

Contributors

Provisions SMB shares using templates that encapsulate best practices for provisioning shares for different types of applications.

Syntax

New-SdSMBShare [-Name]  <String>  [-Path]  <String>  [-CIFSServer]  <String>  [-TemplateName]  <String>  [-ShareProperties]  <String[]>  [-SymlinkProperties]  <String[]>  [-FileUmask]  <Int32>  [-DirUmask]  <Int32>  [-Comment]  <String>  [-AttributeCacheTtl]  <Int32>  [-UserOrGroup]  <String>  [-Permission]  <String>  [-Session]  <String>  [-Host]  <String>  [-Name]  <String>  [-Path]  <String>  [-StorageSystem]  <String>  [-TemplateName]  <String>  [-ShareProperties]  <String[]>  [-SymlinkProperties]  <String[]>  [-FileUmask]  <Int32>  [-DirUmask]  <Int32>  [-Comment]  <String>  [-AttributeCacheTtl]  <Int32>  [-UserOrGroup]  <String>  [-Permission]  <String>  [-Session]  <String>  [-Host]  <String>

Detailed Description

Provisions SMB shares using templates that encapsulate best practices for provisioning shares for different types of applications. Get the provisioning templates from the "templates" folder in your install directory. This cmdlet is supported in clustered Data ONTAP 8.2 and later.Related cmdlets: New-SdVolume

Parameters

Name Description Required? Pipeline Input Default Value

Name

Specifies the name of the SMB share you want to provision. The SMB share name must be a UTF-8 string. You cannot use following characters: control characters from 0x00 to 0x1F, both inclusive, 0x22 (double quotes) and the special characters \/[]:|<>+=;,?

false

true (ByPropertyName)

Path

Designates the file system path that is shared through your SMB share.

false

true (ByPropertyName)

CIFSServer

Specifies the SMB server you want to use for provisioning the share.

false

true (ByPropertyName)

TemplateName

Specifies the provisioning template name. You should also include the path to the template, if the template resides in a folder other than the Templates folder.

false

true (ByPropertyName)

ShareProperties

Provides a list of properties for your SMB share. Possible values: "oplocks", "browsable", "showsnapshot", "changenotify", "homedirectory", "attributecache","continuously-available"

false

true (ByPropertyName)

SymlinkProperties

Indicates whether you want the symlinks under this shared directory to be hidden, accessible, or read-only (option "read-only" along with option "enable".) Possible values are: "enable", "hide", "read_only"

false

true (ByPropertyName)

FileUmask

You can use the value of this field to control the file mode creation mask for the SMB share in qtrees with UNIX or mixed security styles. The file mode create mask restricts the initial permissions setting of a newly created file. The input value is a numeric mode comprised of one to three octal digits (0-7), derived by adding up the bits with values 4, 2, and 1. The first digit selects permissions for the user who owns the file: read (4), write (2), and execute (1). The second selects permissions for other users in the file's group, with the same values. The third is for other users not in the file's group, with the same values.

false

true (ByPropertyName)

DirUmask

You can use the value of this field to control the file mode creation mask for the SMB share in qtrees with UNIX or mixed security styles. The mask restricts the initial permissions setting of a newly created directory. The input value is a numeric mode comprising of one to three octal digits (0-7), derived by adding up the bits with values 4, 2, and 1. The first digit selects permissions for the user who owns the file: read (4), write (2), and execute (1); the second selects permissions for other users in the file's group, with the same values; and the third for other users not in the file's group, with the same values.

false

true (ByPropertyName)

Comment

This optional parameter describes a new SMB share. Your description is visible to SMB clients when they arebrowsing the virtual storage server's SMB shares.

false

true (ByPropertyName)

AttributeCacheTtl

Specifies the lifetime of an entry in the file attribute cache, in seconds. You can use this value if you have set the "attributecache" property set for the share. Setting the "attributecache" property improves the performance of certain metadata operations in common workloads. The default is 10 seconds. The value of this field must be in the range of 1 to 86400. Raising this value may improve performance, but it increases the likelihood that you serve stale metadata.

false

true (ByPropertyName)

UserOrGroup

Specifies the user or group name for which you list the permissions.

false

true (ByPropertyName)

Permission

Indicates access rights that a user or group has on the defined SMB share. Possible values: "no_access", "read", "change", "full_control".

false

true (ByPropertyName)

Session

Specifies the session ID from Open-SmConnection.

false

true (ByPropertyName)

Host

Specifies the name or IP address of the host on which you execute the operation. The default is your local machine.

false

true (ByPropertyName)

StorageSystem

Indicates the virtual storage server you want to use for provisioning the SMB share. The virtual storage server should already have a SMB server configured. You do not need to use this parameter if the SMB server is qualified.

false

true (ByPropertyName)

Examples

Example 1: Provisioning SMB shares

 PS C:\> New-SdSMBShare -Path /Sharename -Name HyperVShare -CIFSServer HyperVFileServer -TemplateName "C:\Program Files\NetApp\SnapCenter\SnapCenter Plug-in for Microsoft Windows"

This example syntax provisions a SMB share using the specified template.