OnCommand Storage Management Software Articles and Resources

Command update - Set Qtree Options (for 1.0.2)

Hello all,

Due to popular request, we have updated our "Set Qtree Options" command to allow setting opportunity locks and security settings on the volume itself.


Just define a Qtree object in define node on the volume in question, with the applicable sec options and locks. For qtree name use "-", as per the picture below:


Command code (For users of older versions and for reference):

param (

  [parameter(Mandatory=$true, HelpMessage="Array name or IP address")]


  [parameter(Mandatory=$true, HelpMessage="Volume name")]


  [parameter(Mandatory=$true, HelpMessage="Qtree name")]


  [parameter(Mandatory=$false, HelpMessage="Virtual Filer name")]


  [parameter(Mandatory=$false, HelpMessage="The new oplocks settings.  Values are enabled or disabled")]

  [ValidateSet("enabled", "disabled")]


  [parameter(Mandatory=$false, HelpMessage="The new security style.  Values are unix, ntfs or mixed")]

  [ValidateSet("unix", "ntfs","mixed")]



# connect to controller

Connect-WFAController -Array $Array -VFiler $VFilerName

if ($QtreeName -eq "-")


    $QtreeName = ""


# Check that Qtree exists

$QtreeStatus = Get-NaQtree -Volumename $VolumeName -QtreeName $QtreeName

if (-Not $QtreeStatus)


    $msg =  "QTree " + $QtreeName + " not found"

    throw $msg


# Path of an existing qtree. The path should be in this format: /vol/volume/qtree or /vol/volume/ to select the volume qtree.

$QtreePath = "/vol/" + $VolumeName + "/" + $QtreeName

Get-WFALogger -Info -message $("Working on qtree: " +$QtreePath)

if ($OpLocks)


    Get-WFALogger -Info -message $("Setting Qtree Oplocks: " +$OpLocks)

    Set-NaQtree -path $QtreePath -OpLocks $OpLocks


if ($SecurityStyle)


    Get-WFALogger -Info -message $("Setting Qtree Security style: " +$SecurityStyle)

    Set-NaQtree -path $QtreePath -SecurityStyle $SecurityStyle



This NetApp Community is public and open website that is indexed by search engines such as Google. Participation in the NetApp Community is voluntary. All content posted on the NetApp Community is publicly viewable and available. This includes the rich text editor which is not encrypted for https.

In accordance to our Code of Conduct and Community Terms of Use DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information
  • Copyrighted materials without the permission of the copyright owner

Files and content that do not abide by the Community Terms of Use or Code of Conduct will be removed. Continued non-compliance may result in NetApp Community account restrictions or termination.