Add a home directory share
If you want to use the SMB home directory feature, you must add at least one share with the home directory property included in the share properties.
You can create a home directory share at the time you create the share by using the
vserver cifs share create command, or you can change an existing share into a home directory share at any time by using the
vserver cifs share modify command.
To create a home directory share, you must include the
homedirectory value in the
-share-properties option when you create or modify a share. You can specify the share name and share path using variables that are dynamically expanded when users connect to their home directories. Available variables that you can use in the path are
%u, corresponding to the Windows user name, domain, and mapped UNIX user name, respectively.
Add a home directory share:
vserver cifs share create -vserver vserver_name -share-name share_name -path path -share-properties homedirectory[,…]
vserverspecifies the CIFS-enabled storage virtual machine (SVM) on which to add the search path.
-share-name share-namespecifies the home directory share name.
In addition to containing one of the required variables, if the share name contains one of the literal strings
%d, you must precede the literal string with a % (percent) character to prevent ONTAP from treating the literal string as a variable (for example,
The share name must contain either the
The share name can additionally contain the
%dvariable (for example,
%w) or a static portion in the share name (for example, home1_
If the share is used by administrators to connect to other users' home directories or to permit users to connect to other users' home directories, the dynamic share name pattern must be preceded by a tilde (~).
vserver cifs home-directory modifyis used to enable this access by setting the
true) or by setting the advanced option
pathspecifies the relative path to the home directory.
-share-properties homedirectory[,…] specifies the share properties for that share. You must specify the
homedirectory value. You can specify additional share properties using a comma delimited list.
Verify that you successfully added the home directory share by using the
vserver cifs share showcommand.
The following command creates a home directory share named
changenotify share properties are set in addition to setting the
homedirectory share property.
This example does not display output for all of the shares on the SVM. Output is truncated.
cluster1::> vserver cifs share create -vserver vs1 -share-name %w -path %w -share-properties oplocks,browsable,changenotify,homedirectory vs1::> vserver cifs share show -vserver vs1 Vserver Share Path Properties Comment ACL ---------- -------- ------------ -------------- -------- ----------- vs1 %w %w oplocks - Everyone / Full Control browsable changenotify homedirectory