Active IQ Unified Manager Discussions

Add CIFS share propreties in WFA

NTA1201
1,404 Views

Hello,

 

I would like to enable acces-based-enumeration on CIFS share create Workflow.

I know I have to add parameters definition but as I'm new in WFA I have no clue how to do it.

Can you pls give me step by step procedure?

 

Here is my "create CIFS share" power shell command:

param (
  [parameter(Mandatory=$true, HelpMessage="Name or IP address of the cluster hosting the Storage Virtual Machine.")]
  [string]$Cluster,

  [parameter(Mandatory=$true, HelpMessage="Name of the Storage Virtual Machine in which the CIFS share will be created.")]
  [string]$Vserver,

  [parameter(Mandatory=$true, HelpMessage="File system path that is shared through this CIFS share.")]
  [string]$Path,

  [parameter(Mandatory=$true, HelpMessage="Name of the CIFS share to be created.")]
  [string]$ShareName,

  [parameter(Mandatory=$false, HelpMessage="Option which determines whether SMB encryption is required for incoming CIFS traffic. By default this option is false.")]
  [ValidateSet("true","false")]
  [string]$EncryptData,

  [parameter(Mandatory=$false, HelpMessage="A comment that gives a description of the CIFS share. CIFS clients see this description when browsing the Storage Virtual Machine's CIFS shares.")]
  [string]$Comment
)

Get-WFALogger -Info -message $("Creating CIFS share: " + $ShareName + "at path: "+ $Path)

$command = "Add-NcCifsShare -Name " +  $ShareName + " -Path " + $Path

# Add share
if ($Comment)
{
    $command += " -Comment " + "'" + $Comment + "'"
}

if ($EncryptData -eq "true")
{
    $command += " -ShareProperties encrypt_data"
}

$command += " -VserverContext " + $Vserver

# connect to cluster
Connect-WfaCluster $Cluster

Try
{
    $result = Invoke-Expression -ErrorAction stop $command
}
Catch
{
    $ErrorMessage = $_.Exception.Message
    throw "Create CIFS share failed. Reason : " + $ErrorMessage
}
if ($result.Status -eq "failed")
 {
    throw "Create CIFS share failed. Reason : " + $result.ErrorMessage
 }

 

Thx.

 

 

0 REPLIES 0
Public