Microsoft Virtualization Discussions

Set-NcCifsShare won't set OpLocks, ChangeNotify, and ABE.

JonR
1,491 Views

I created a test share using the powershell module NetApp.ONTAP 9.12.1.2302 against a NetApp running NetApp Release 9.11.1P7.

 

Connect-NcController <NetApp ClusterName>

$global:CurrentNcController.Vserver = <VServerName>

Add-NcCifsShare -name Test1 -Oplocks $true -AccessBasedEnumeration $true -ChangeNotify $true -Path /<flexGroupName>

 

The share is successfully created, but does not have the three settings set, so I tried to modify them:

 

Set-NcCifsShare -Name Test1 -Oplocks $true

 

When I do that, it does not give me feedback that something went wrong, but it also does not set the OpLocks to be true.  Also, if I have manually turned on one of the three mentioned settings, it turns all three off!  I tried it by creating the share with Add-NcCifsShare and using -ShareProperties @("oplocks","accessbasedenumberation","changenotify"), then I get this: 

 

Add-NcCifsShare: ShareProperties parameter specified, which is not supported for REST call

 

I will have to create a hundred shares in the next few days, and I really REALLY don't want to do it manually.  What am I missing? 

3 REPLIES 3

RobDBA
1,415 Views

This worked for me, or at least the last time I tried it did, to remove the browsable flag. And I've found it's usually a good idea to get the object in powershell before you set the object.  Also, I don't even see '-Oplocks' as a valid option to Set-NcCifsShare in the toolkit version I'm using.

 

Get-NcCifsShare ${DBUpper}_Images | Set-NcCifsShare -ShareProperties ('oplocks','changenotify','show_previous_versions')

RobDBA
1,413 Views

Here is some sample code I use to add a share and set the permissions on it.

 

Get-NcVol ${DBUpper}_Images | ForEach-Object {
    $_ | Add-NcCifsShare -Name ${DBUpper}_Images -Path /dbvol/${DBUpper}_Images -ShareProperties ('oplocks','changenotify','show_previous_versions')
    #Remove the "everyone" permission
    Get-NcCifsShareAcl ${DBUpper}_Images | Remove-NcCifsShareAcl
    $_ | Add-NcCifsShareAcl -Share ${DBUpper}_Images -UserOrGroup 'SOS\SOS-BMV-IS' -Permission read
    $_ | Add-NcCifsShareAcl -Share ${DBUpper}_Images -UserOrGroup 'SOS\'+${env:USERNAME} -Permission full_control
}

 

JonR
1,405 Views

Thanks for the info.  I did some playing after you said "The version I'm using", and removed the 9.12.1.2302 version I had installed, and installed the next last version that was 9.11.1.2208.  I ran my commands from before verbatim, and it worked.  I guess there is a problem with the newer version.  

Public