<?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: PowerShell Toolkit - Automating Qtree and Share Creation Issues in PowerShell Discussions</title>
    <link>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/465227#M46</link>
    <description>&lt;P&gt;Seems that the 'ShareProperties' is STILL broken in version&amp;nbsp;9.17.1.2509.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set-NcCifsShare -Name "share01-test" -SymlinkProperties enable -AccessBasedEnumeration $true -ShareProperties "browsable" -VserverContext "SFS0S"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message&lt;BR /&gt;Set-NcCifsShare: ShareProperties parameter specified, which is not supported for REST call&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jan 2026 15:18:07 GMT</pubDate>
    <dc:creator>MattBaldwin</dc:creator>
    <dc:date>2026-01-16T15:18:07Z</dc:date>
    <item>
      <title>PowerShell Toolkit - Automating Qtree and Share Creation Issues</title>
      <link>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/460597#M39</link>
      <description>&lt;P&gt;I am working on some automation using powershell and the powershell toolkit.&amp;nbsp; After creating a qtree and then its share, I am trying to set the 'ShareProperties' parameter, "browsable", which correlates to the checkbox in the UI for "allow client access to snapshot copies directory".&amp;nbsp;&amp;nbsp; It fails saying, "ShareProperties parameter specified, which is not supported for REST call".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried it with Set-NcCifsShare and Add-NcCifsShare.&amp;nbsp; I am running the powershell module for NetApp.ONTAP Version: 9.16.1.2501 in PowerShell 7.5.1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An example of the script.&amp;nbsp; If I take out the shareproperties piece, it works perfectly.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Set-NcCifsShare -Name $shareName -SymlinkProperties enable  -AccessBasedEnumeration $true -ShareProperties "browsable" -VserverContext $storageVM&lt;/LI-CODE&gt;&lt;P&gt;Is there any way to set that option via PowerShell?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 20:13:25 GMT</pubDate>
      <guid>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/460597#M39</guid>
      <dc:creator>MattBaldwin</dc:creator>
      <dc:date>2025-05-09T20:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Toolkit - Automating Qtree and Share Creation Issues</title>
      <link>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/460600#M40</link>
      <description>&lt;P&gt;Hey Matt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;browsable &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;parameter was introduced in the REST API in ONTAP 9.13&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/protocols/cifs/shares/{svm.uuid}/{name}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's possible that the PSTK CmdLet has not yet been updated to support setting this property (although it is possible if you use the native REST API). You could either write a PowerShell Function that invokes the REST API externally to the PSTK or alternately you can use the -ZapiCall parameter on the "Connect-NcController" CmdLet which will force the connection to the cluster to use ZAPI instead of the REST API and then you should be able to set the "ShareProperties" parameter to "&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;browsable"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 04:31:13 GMT</pubDate>
      <guid>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/460600#M40</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2025-05-12T04:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Toolkit - Automating Qtree and Share Creation Issues</title>
      <link>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/460602#M41</link>
      <description>&lt;P&gt;Hey Matt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just FYI if a PowerShell CmdLet doesn't support setting a value you can either use the Private REST CLI to invoke an SSH command HTTPS or if the PSTK CmdLet doesn't support setting a property value but the REST API does and you don't want to use ZAPI you can write your own functions around the native ONTAP REST API's. Here's an example that enables you to set a CIFS share property value using REST and PowerShell&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Param(
   [Parameter(Mandatory = $True, HelpMessage = "The IP Address of the Cluster or SVM")]
   [String]$Cluster,
   [Parameter(Mandatory = $True, HelpMessage = "The Vserver Name")]
   [String]$VserverName,
   [Parameter(Mandatory = $False, HelpMessage = "The Vserver UUID")]
   [String]$VserverID,
   [Parameter(Mandatory = $True, HelpMessage = "The CIFS Share Name")]
   [String]$ShareName,
   [Parameter(Mandatory = $True, HelpMessage = "The CIFS Share Property")]
   [ValidateSet("oplocks","browsable","showsnapshot","changenotify","homedirectory","attributecache")]
   [String]$ShareProperty,
   [Parameter(Mandatory = $True, HelpMessage = "The CIFS Share Property Enabled State")]
   [Bool]$Enabled,
   [Parameter(Mandatory = $True, HelpMessage = "The Credential to authenticate to the Cluster or SVM")]
   [ValidateNotNullOrEmpty()]
   [System.Management.Automation.PSCredential]$Credential
)
#'------------------------------------------------------------------------------
Function Get-OntapVserver{
   [CmdletBinding()]
   Param(
      [Parameter(Mandatory = $True, HelpMessage = "The Cluster Name or IP Address")]
      [String]$Cluster,
      [Parameter(Mandatory = $True, HelpMessage = "The Vserver Name")]
      [String]$VserverName,
      [Parameter(Mandatory = $True, HelpMessage = "The Credential to authenticate to the Cluster")]
      [ValidateNotNullOrEmpty()]
      [System.Management.Automation.PSCredential]$Credential
   )
   #'---------------------------------------------------------------------------
   #'Set the authentication header to connect to AIQUM.
   #'---------------------------------------------------------------------------
   $headers = Get-UMAuthorization -Credential $Credential
   #'---------------------------------------------------------------------------
   #'Enumerate the vservers.
   #'---------------------------------------------------------------------------
   [String]$uri = "https://$Cluster/api/svm/svms?name=$VserverName"
   Try{
      $response = Invoke-RestMethod -Uri $uri -Method GET -Headers $headers -ErrorAction Stop
      Write-Host "Enumerated Vserver ""$VserverName"" on Cluster ""$Cluster"" using URI ""$uri"""
   }Catch{
      Write-Warning -Message $("Failed enumerating Vserver ""$VserverName"" on Cluster ""$Cluster"" using URI ""$uri"". Error " + $_.Exception.Message + ". Status Code " + $_.Exception.Response.StatusCode.value__)
   }
   Return $response;
}#'End Function Get-OntapVserver.
#'------------------------------------------------------------------------------
Function Set-OntapCifsShareProperty{
   [CmdletBinding()]
   Param(
      [Parameter(Mandatory = $True, HelpMessage = "The IP Address of the Cluster or SVM")]
      [String]$Cluster,
      [Parameter(Mandatory = $True, HelpMessage = "The Vserver Name")]
      [String]$VserverName,
      [Parameter(Mandatory = $False, HelpMessage = "The Vserver UUID")]
      [String]$VserverID,
      [Parameter(Mandatory = $True, HelpMessage = "The CIFS Share Name")]
      [String]$ShareName,
      [Parameter(Mandatory = $True, HelpMessage = "The CIFS Share Property")]
      [ValidateSet("oplocks","browsable","showsnapshot","changenotify","homedirectory","attributecache")]
      [String]$ShareProperty,
      [Parameter(Mandatory = $True, HelpMessage = "The CIFS Share Property Enabled State")]
      [Bool]$Enabled,
      [Parameter(Mandatory = $True, HelpMessage = "The Credential to authenticate to the Cluster or SVM")]
      [ValidateNotNullOrEmpty()]
      [System.Management.Automation.PSCredential]$Credential
   )
   #'---------------------------------------------------------------------------
   #'Enumerate the Vserver UUID if not provided.
   #'---------------------------------------------------------------------------
   If(-Not($VserverID)){
      $vserver = Get-OntapVserver -Cluster $Cluster -VserverName $VserverName -Credential $Credential
      If(($Null -eq $Vserver) -Or ($vserver.num_records -ne 1)){
         Write-Warning -Message "Failed enumerating UUID for Vserver ""$VserverName"" on Cluster ""$Cluster"""
         Return $Null;
      }Else{
         [String]$VserverID = $vserver.records.uuid
      }
   }
   #'---------------------------------------------------------------------------
   #'Set the CIFS Share Property.
   #'---------------------------------------------------------------------------
   [String]$url = "https://$Cluster/api/protocols/cifs/shares/$VserverID/$ShareName"
   $json = @{"$ShareProperty" = $Enabled.ToString()}
   $body = $json | ConvertTo-Json
   Try{
      $response = Invoke-RestMethod -Method Patch -Body $body -Uri $url -Credential $Credential -ErrorAction Stop
      Write-Host "Set CIFS Share ""$ShareName"" Property ""$ShareProperty"" on Vserver ""$VserverName"" on Cluster ""$Cluster"" using URL`: ""$url"""
   }Catch{
      Write-Warning -Message $("Failed setting CIFS Share Property ""$ShareProperty"" on Vserver ""$VserverName"" on Cluster ""$Cluster"" using URL`: ""$url"". Error " + $_.Exception.Message)
   }
   Return $response;
}#'End Function Set-OntapCifsShareProperty.
#'------------------------------------------------------------------------------
Function Get-UMAuthorization{
   [Alias("Get-UMAuth")]
   [CmdletBinding()]
   Param(
      [Parameter(Mandatory = $True, HelpMessage = "The Credential to authenticate to AIQUM")]
      [ValidateNotNullOrEmpty()]
      [System.Management.Automation.PSCredential]$Credential
   )
   #'---------------------------------------------------------------------------
   #'Set the authentication header to connect to AIQUM.
   #'---------------------------------------------------------------------------
   $auth    = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($Credential.UserName + ':' + $Credential.GetNetworkCredential().Password))
   $headers = @{
      "Authorization" = "Basic $auth"
      "Accept"        = "application/json"
      "Content-Type"  = "application/json"
   }
   Return $headers;
}#'End Function Get-UMAuthorization.
#'------------------------------------------------------------------------------
#'Set the certificate policy and TLS version.
#'------------------------------------------------------------------------------
Add-Type @"
   using System.Net;
   using System.Security.Cryptography.X509Certificates;
   public class TrustAllCertsPolicy : ICertificatePolicy {
   public bool CheckValidationResult(
   ServicePoint srvPoint, X509Certificate certificate,
   WebRequest request, int certificateProblem) {
      return true;
   }
}
"@
#[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
#'------------------------------------------------------------------------------
#'Disable SSL Check.
#'------------------------------------------------------------------------------
$sslHandler = @"
public class SSLHandler{
   public static System.Net.Security.RemoteCertificateValidationCallback GetSSLHandler(){
      return new System.Net.Security.RemoteCertificateValidationCallback((sender, certificate, chain, policyErrors) =&amp;gt; { return true; });
   } 
}
"@
Add-Type -TypeDefinition $sslHandler
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = [SSLHandler]::GetSSLHandler()
#'------------------------------------------------------------------------------
$response = Set-OntapCifsShareProperty -Cluster $Cluster -VserverName $VserverName -ShareName $ShareName -ShareProperty $ShareProperty -Enabled $Enabled -Credential $Credential
$response&lt;/LI-CODE&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;PS C:\Scripts\PowerShell\Projects\SetCifsShareProperty&amp;gt; $Credential = Get-Credential
PS C:\Scripts\PowerShell\Projects\SetCifsShareProperty&amp;gt; .\SetCifsShareProperty.ps1 -Cluster 192.168.100.2 -VserverName svm1 -ShareName "share1`$" -ShareProperty browsable -Enabled $true -Credential $credential
Enumerated Vserver "svm1" on Cluster "192.168.100.2" using URI "https://192.168.100.2/api/svm/svms?name=svm1"
Set CIFS Share "share1$" Property "browsable" on Vserver "svm1" on Cluster "192.168.100.2" using URL: "https://192.168.100.2/api/protocols/cifs/shares/939ee27e-e202-11ef-aef5-00a098bd4884/testshare$"


cluster1::&amp;gt; cifs share show -vserver svm1 -share-name share1$ -fields share-properties
vserver      share-name  share-properties
------------ ----------- -----------------------------------------------------
svm1 share1$ oplocks,browsable,changenotify,show-previous-versions&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 05:20:42 GMT</pubDate>
      <guid>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/460602#M41</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2025-05-12T05:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Toolkit - Automating Qtree and Share Creation Issues</title>
      <link>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/460611#M42</link>
      <description>&lt;P&gt;Thank you both for the replies!&amp;nbsp; Do you think this is something that will eventually be added to the PSTK?&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 13:22:52 GMT</pubDate>
      <guid>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/460611#M42</guid>
      <dc:creator>MattBaldwin</dc:creator>
      <dc:date>2025-05-12T13:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Toolkit - Automating Qtree and Share Creation Issues</title>
      <link>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/460619#M43</link>
      <description>&lt;P&gt;Hey Matt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I would assume this will be fixed in a future PSTK as it's possible to set the browsable CIFS Share property via the REST API. I'll ping the dev team to put it on their radar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 01:50:40 GMT</pubDate>
      <guid>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/460619#M43</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2025-05-13T01:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Toolkit - Automating Qtree and Share Creation Issues</title>
      <link>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/460634#M44</link>
      <description>&lt;P&gt;Sounds good.&amp;nbsp; Thanks, Matt.&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 13:05:39 GMT</pubDate>
      <guid>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/460634#M44</guid>
      <dc:creator>MattBaldwin</dc:creator>
      <dc:date>2025-05-13T13:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Toolkit - Automating Qtree and Share Creation Issues</title>
      <link>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/464037#M45</link>
      <description>&lt;P&gt;Hello all.&amp;nbsp; Do we know if this was ever implemented?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2025 18:30:34 GMT</pubDate>
      <guid>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/464037#M45</guid>
      <dc:creator>MattBaldwin</dc:creator>
      <dc:date>2025-10-31T18:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Toolkit - Automating Qtree and Share Creation Issues</title>
      <link>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/465227#M46</link>
      <description>&lt;P&gt;Seems that the 'ShareProperties' is STILL broken in version&amp;nbsp;9.17.1.2509.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set-NcCifsShare -Name "share01-test" -SymlinkProperties enable -AccessBasedEnumeration $true -ShareProperties "browsable" -VserverContext "SFS0S"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message&lt;BR /&gt;Set-NcCifsShare: ShareProperties parameter specified, which is not supported for REST call&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jan 2026 15:18:07 GMT</pubDate>
      <guid>https://community.netapp.com/t5/PowerShell-Discussions/PowerShell-Toolkit-Automating-Qtree-and-Share-Creation-Issues/m-p/465227#M46</guid>
      <dc:creator>MattBaldwin</dc:creator>
      <dc:date>2026-01-16T15:18:07Z</dc:date>
    </item>
  </channel>
</rss>

