<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CIFS Home Directories Creation in Network and Storage Protocols</title>
    <link>https://community.netapp.com/t5/Network-and-Storage-Protocols/CIFS-Home-Directories-Creation/m-p/129794#M8734</link>
    <description>&lt;P&gt;Thanks fo the information.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Apr 2017 15:05:29 GMT</pubDate>
    <dc:creator>adamsmc</dc:creator>
    <dc:date>2017-04-04T15:05:29Z</dc:date>
    <item>
      <title>CIFS Home Directories Creation</title>
      <link>https://community.netapp.com/t5/Network-and-Storage-Protocols/CIFS-Home-Directories-Creation/m-p/129773#M8732</link>
      <description>&lt;P&gt;We have been researching how to implement CIFS home directories in our environment. We need to be able to automate the folder creation process for a user. Can anyone confirm that NetApp does not autocreate the folder? How do others automate this process of creating and deleting users home directories?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using Ontap 9&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 15:14:52 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Network-and-Storage-Protocols/CIFS-Home-Directories-Creation/m-p/129773#M8732</guid>
      <dc:creator>adamsmc</dc:creator>
      <dc:date>2025-06-04T15:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: CIFS Home Directories Creation</title>
      <link>https://community.netapp.com/t5/Network-and-Storage-Protocols/CIFS-Home-Directories-Creation/m-p/129792#M8733</link>
      <description>&lt;P&gt;Hi Adam -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ONTAP has some good home directory share mechanisms, but as you say, to my knowledge, autocreate of the folder isn't one of them.&amp;nbsp; The mechanism I've used at scale leverages the&amp;nbsp;dynamic home shares which goes a long way to aid&amp;nbsp;automation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In an SVM, you can&amp;nbsp;designate a path (or paths) as a home directory location.&amp;nbsp; These are the base paths relative to storage where home directories might be located - you might have more than one in a large environment spread across multiple volumes, nodes, etc.&amp;nbsp; The actual user homedirs are created under these base directory paths.&amp;nbsp; So for automation, what I have done in conjunction with the AD user admin team is to create the home directory locations on storage and created a hidden share for those locations only accessible to a "user creation" service account.&amp;nbsp; The script which adds the user to AD also creates the user's homedir folder under a designated home directory path using the share and the service account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The next logical step in general terms would be to create a share and/or set permissions on the user specific homedir just&amp;nbsp;created.&amp;nbsp; Those steps can be skipped if you use dynamic home directory share mapping, another feature in ONTAP which simplifies things as well.&amp;nbsp; You don't have to give an account access to the SVM to create new shares, instead you can define a single share using dynamically supplied data that will active a share on demand for every user.&amp;nbsp; So here's how this works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's say we create and mount (junction-path) a volume at "/home".&amp;nbsp; In the SVM, we add that to the home directory search path using "vserver cifs home-directory search-path add -path /home".&amp;nbsp; Now define a single share that uses variable substitution to define the share name and the path &lt;EM&gt;relative&lt;/EM&gt; to the home directories.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This takes a little explanation.&amp;nbsp; A normal share of course is a share-name, for instance "shared" and a path relative to the root of the SVM, for instance&amp;nbsp;"/myvolume/shared" which you create with the usual "vserver cifs share create -vserver SVM1 -share-name shared -path /myvolume/shared" command.&amp;nbsp; Dynamic home directories are different.&amp;nbsp; You will specify on the share creation that a dynamic home directory share is specifically for home directories using a share property "home-directory".&amp;nbsp; Then you can use the following dynamic variables in the share name and share path:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%w - the user's Windows user name&lt;/P&gt;&lt;P&gt;%d - the user's Windows domain name&lt;/P&gt;&lt;P&gt;%u - the user's UNIX user name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The path created is relative to any of the defined home directory search paths - so you can have multiple locations where it would be.&amp;nbsp; An example helps:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's assume SVM has two volumes on different aggregates, mounted at "/home1" and "/home2".&amp;nbsp; So first we add them to the home directory search paths:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;vserver cifs home-directory search-path add -vserver SVM1 -path /home1&lt;/P&gt;&lt;P&gt;vserver cifs home-directory search-path add -vserver SVM1 -path /home2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good.&amp;nbsp; So now we define a dynamic share for home directories.&amp;nbsp; Let's assume we want to further break up the volumes by putting the user's domain as part of the file path - that is user "DOM1\BOB" might be be physically stored&amp;nbsp;on the volume as&amp;nbsp;/home1/DOM1/BOB.&amp;nbsp; Let's further assume that the share name we want to be a little unique for clarity, so we want the share name to be "HD_BOB" - that is HD for home directory and the user name as part of the share name.&amp;nbsp; So we we expect user BOB to connect to \\SVM1\HD_BOB and get to actual path /home1/DOM1/BOB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The share we define like this:&amp;nbsp; vserver cifs share create -share-name HD_%w -path %d/%w -properties homedirectory,oplocks,browseable,changenotify&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notice that the share creation doesn't specify /home1 or /home2.&amp;nbsp; Because it uses the property "homedirectory", this share is automatically checking both physical locations as defined by the home-directory share paths.&amp;nbsp; When user "DOM1\BOB" attempts to connect to share \\SVM1\HD_BOB, the SVM sees that the share name matches the "HD_%w" definition, because here %w is dynamically substituted with the Windows user name "BOB".&amp;nbsp; The share has the home directory property set, so the the SVM now&amp;nbsp;searches the home directory path list for locations /home1/DOM1/BOB and /home2/DOM1/BOB, again substituting in the physical path of the share definition.&amp;nbsp; The search order is&amp;nbsp;configurable based on how the home&amp;nbsp;directory search paths are maintained.&amp;nbsp; Since for this user there is a match, the SVM connects \\SVM1\HD_BOB to /home1/DOM1/BOB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By default, if any other user attempts to connect to the same path, it will fail because the substitutions are based on the connecting user's defined credentials.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To bring this all together for automation.&amp;nbsp; I define a home directory base path "/home1" and share it as "HOME1$" and assign security only for a service account to create and delete folders.&amp;nbsp; When a user creation process fires, the script connects to the HOME$ share and creates a folder with the same name as the user.&amp;nbsp; The same script updates the home directory of the user to be \\SVM1\username.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've already defined a share with the homedirectory property as share-name "%w" and path "%w".&amp;nbsp; This dynamically matches every user to their folder under the "/home1" path in this example.&amp;nbsp; So no SVM level administrative access is required to make this work.&amp;nbsp; Because it's a home directory, the security is also hard locked to the connecting user, so no extra permissions or security settings are needed at the folder level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also use the option to configure home directory access for administrative users.&amp;nbsp; This allows users defined as in the "BUILTIN\Administrators" group on the SVM CIFS configuration to access home directories as well for whatever reason needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gets rather involved to understand at first, but it's very powerful at scale.&amp;nbsp; It greatly simplifies SVM management activities around home directory management.&amp;nbsp; There are a few gotcha's - first is that the Windows GUI functionality to set someone's homedirectory doesn't work as you'd expect.&amp;nbsp; Assume you have a service user who has permission to update a users home directory as part of their role.&amp;nbsp; When using the Windows GUI to change a user's properties, the GUI tries to protect you from yourself.&amp;nbsp; For instance, if I set a user home directory, the GUI will first check to see if that share exists and is accessible.&amp;nbsp; But, I'm not the matching user, so by default it isn't accessible to just anyone.&amp;nbsp; Thus setting the home directory property in the GUI fails.&amp;nbsp; PowerShell scripting will succeed because it doesn't do such "protection" checks - it just does what you ask it to do whether right or wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second gotcha is trying to get overly complex with where home directory data is stored.&amp;nbsp; You can create some huge data structures and divisions to store the data.&amp;nbsp; Doesn't mean you should - whatever you create on the storage side the user creation script must also understand.&amp;nbsp; Also, the user creation script, if there are home directory paths to search, must determine on it's own which of the multiple paths might be used to create a new user folder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally - you must ensure absolutely unique usernames/sharenames.&amp;nbsp; This is especially true if you have&amp;nbsp;multiple domains with trusts - you could easily create a dynamic share that matches the same user name in different domains to the same share name.&amp;nbsp; Not likely what you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The online ONTAP 9 documentation center has much more info available.&amp;nbsp; You can find it under the path &lt;A href="http://docs.netapp.com/ontap-9/topic/com.netapp.nav.pp/home.html" target="_blank"&gt;&lt;U&gt;&lt;FONT color="#0066cc"&gt;Provisioning and protocols&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt; &amp;gt; &lt;A href="http://docs.netapp.com/ontap-9/topic/com.netapp.doc.cdot-famg-cifs/home.html" target="_blank"&gt;&lt;U&gt;&lt;FONT color="#0066cc"&gt;CIFS management&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt; &amp;gt; &lt;A href="http://docs.netapp.com/ontap-9/topic/com.netapp.doc.cdot-famg-cifs/GUID-3BED603F-C3CB-4BBC-85B2-986B1B4D6C3D.html" target="_blank"&gt;&lt;U&gt;&lt;FONT color="#0066cc"&gt;Deploying CIFS server-based services&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;&amp;nbsp;topic Managing home directories.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bob Greenwald&lt;/P&gt;&lt;P&gt;Senior Systems Engineer | &lt;STRONG&gt;&lt;A title="cStor | We look Beyond IT" href="http://cstor" target="_blank"&gt;&lt;FONT color="#00ccff"&gt;&lt;FONT color="#000000"&gt;c&lt;/FONT&gt;Stor&lt;/FONT&gt;&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;NCIE SAN ONTAP, Data Protection&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;EM&gt;Kudos and accepted answers are never necessary, but always appreciated.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 14:54:19 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Network-and-Storage-Protocols/CIFS-Home-Directories-Creation/m-p/129792#M8733</guid>
      <dc:creator>bobshouseofcards</dc:creator>
      <dc:date>2017-04-04T14:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: CIFS Home Directories Creation</title>
      <link>https://community.netapp.com/t5/Network-and-Storage-Protocols/CIFS-Home-Directories-Creation/m-p/129794#M8734</link>
      <description>&lt;P&gt;Thanks fo the information.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 15:05:29 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Network-and-Storage-Protocols/CIFS-Home-Directories-Creation/m-p/129794#M8734</guid>
      <dc:creator>adamsmc</dc:creator>
      <dc:date>2017-04-04T15:05:29Z</dc:date>
    </item>
  </channel>
</rss>

