In a Windows environment, CIFS shares are a common occurrence and a necessity for many services such as Active Directory and print services. Setting up a share on a Windows server is a fairly simple task. We create a folder, enable sharing, set permissions. Netapp has been a leader in storage technology and also has the capability to serve CIFS shares. My experience with Netapp has been extremely positive as their storage systems are very solid and rarely have outages. Today I will show how we can create a share on a Netapp Clustered Mode system with Netapp’s PowerShell module.

Prerequisites:

For this example I am connecting to a management interface on a Netapp storage SVM (Storage virtual machine) with the name FAS-SVM. This share named ‘finance’ will be used for an Active Directory group named ‘DOMAINFinanceGroup to share their files’.
1. First we login to the system with the Connect-NCController command. This will create a persistent session with FAS-SVM so that going forward any commands that run will be against this system.
2. Next, we will create a directory on ‘vol1’ for our CIFS share named ‘finance’. I set the permissions to 777 so that everyone has access to the directory.

3. Time to create the CIFS share on the ‘finance’ folder. We will use the command Add-NcCIFSShare for this. Note that there are several parameters we can use. One important parameter is -ShareProperties. From the module help we can see our options:
For this example lets make the CIFS share browsable and showsnapshots.
4. Now that our ‘finance’ share is created, we will set our CIFS permissions. We will use the Add-NcCifsShareACL command to give the AD security group ‘DOMAINFinanceGroup’ full control. We specify the parameter as ‘windows’ for -UserOrGroup.
Done! Pretty simple eh? You can see how we could easily put these steps into a function for repeatable use in PowerShell.
To summarize the steps this is what we did:
  • Connected to our Netapp system
  • Created a directory on a volume
  • Created a CIFS share on that directory
  • Added CIFS permissions using an Active Directory security group

Leave a Reply

Your email address will not be published. Required fields are marked *