<?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 can't optain cifs options using RestAPI on pstk 9.16.1.2501 in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/459549#M7035</link>
    <description>&lt;P&gt;i'm trying to get all cifs options from a svm via pstk (9.16.1.2501)&lt;/P&gt;&lt;P&gt;using option -ZapiCall gives me all the options with values.&lt;/P&gt;&lt;P&gt;Without this option there are only some options populated with settings, for most of them i see the value false.&lt;/P&gt;&lt;P&gt;studying the help for the command didnt reveal how to do this via rest.&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Mar 2025 09:14:12 GMT</pubDate>
    <dc:creator>Enagon</dc:creator>
    <dc:date>2025-03-20T09:14:12Z</dc:date>
    <item>
      <title>can't optain cifs options using RestAPI on pstk 9.16.1.2501</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/459549#M7035</link>
      <description>&lt;P&gt;i'm trying to get all cifs options from a svm via pstk (9.16.1.2501)&lt;/P&gt;&lt;P&gt;using option -ZapiCall gives me all the options with values.&lt;/P&gt;&lt;P&gt;Without this option there are only some options populated with settings, for most of them i see the value false.&lt;/P&gt;&lt;P&gt;studying the help for the command didnt reveal how to do this via rest.&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 09:14:12 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/459549#M7035</guid>
      <dc:creator>Enagon</dc:creator>
      <dc:date>2025-03-20T09:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: can't optain cifs options using RestAPI on pstk 9.16.1.2501</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/459571#M7036</link>
      <description>&lt;P&gt;Hi Enagon,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you please provide the debug logs on &lt;STRONG&gt;ng-ontap-pstk-queries@netapp.com&lt;/STRONG&gt; DL from the cmdlet execution? This will assist us in identifying the issue. You can enable debug logging by using the &lt;STRONG&gt;Set-NatoolkitConfiguration debug&lt;/STRONG&gt; command.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 21:03:36 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/459571#M7036</guid>
      <dc:creator>saharsh</dc:creator>
      <dc:date>2025-03-20T21:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: can't optain cifs options using RestAPI on pstk 9.16.1.2501</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/459576#M7038</link>
      <description>&lt;P&gt;Hi Enagon,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there's an issue that requires you to revert to ZAPI you can always use the private REST CLI to invoke a command via HTTPS. Here's an example to get the CIFS options:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;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 Credentials to authenticate to the cluster")]
   [System.Management.Automation.PSCredential]$Credential
)
#'------------------------------------------------------------------------------
#'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]::SecurityProtocol  = [System.Net.SecurityProtocolType]'Tls12'
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
#'------------------------------------------------------------------------------
Function Get-NcAuthorization{
   [Alias("Get-NcAuth")]
   [CmdletBinding()]
   Param(
      [Parameter(Mandatory = $True, HelpMessage = "The Credential to authenticate to the cluster")]
      [ValidateNotNullOrEmpty()]
      [System.Management.Automation.PSCredential]$Credential
   )
   #'---------------------------------------------------------------------------
   #'Set the authentication header to connect to the cluster.
   #'---------------------------------------------------------------------------
   $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-NcAuthorization.
#'------------------------------------------------------------------------------
$command = "vserver cifs options show -vserver $VserverName"
$headers = Get-NcAuth -Credential $Credential
$uri     = "https://$Cluster/api/private/cli/vserver/cifs/options?vserver=$VserverName&amp;amp;fields=client_session_timeout,default_unix_group,default_unix_user,read_grants_exec,wins_servers"
#'------------------------------------------------------------------------------
#'Invoke the command via the private REST CLI.
#'------------------------------------------------------------------------------
Write-Host "Executing Command`: $command"
Try{
   $response = Invoke-RestMethod -Method GET -Uri $uri -Headers $headers -ErrorAction Stop
}Catch{
   Write-Warning -Message $("Failed Executing Command`: $command. Error " + $_.Exception.Message)
   Break;
}
#'------------------------------------------------------------------------------
#'Display the records.
#'------------------------------------------------------------------------------
If($Null -eq $response -Or $response.num_records -eq 0){
   Write-Warning -Message "No records were returned from executing command`: $command"
}Else{
   $response.records
}
#'------------------------------------------------------------------------------&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example Output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;PS C:\Scripts\PowerShell\Projects\GetCifsOptions&amp;gt; .\GetCifsOptions.ps1 -Cluster 192.168.100.2 -VserverName vserver1 -Credential $credential
Executing Command: vserver cifs options show -vserver svm_nfs_cifs

vserver                : vserver1
default_unix_user      : pcuser
read_grants_exec       : disabled
wins_servers           : {}
client_session_timeout : 900&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>Fri, 21 Mar 2025 01:07:49 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/459576#M7038</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2025-03-21T01:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: can't optain cifs options using RestAPI on pstk 9.16.1.2501</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/459644#M7039</link>
      <description>&lt;P&gt;Hi saharsh,&lt;/P&gt;&lt;P&gt;i just collected the debug log and sent it to the address you mentioned.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 07:40:44 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/459644#M7039</guid>
      <dc:creator>Enagon</dc:creator>
      <dc:date>2025-03-26T07:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: can't optain cifs options using RestAPI on pstk 9.16.1.2501</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/459645#M7040</link>
      <description>&lt;P&gt;Hi mbeattie,&lt;/P&gt;&lt;P&gt;your script works well, but one question: how to get all fields without naming them ?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 07:50:43 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/459645#M7040</guid>
      <dc:creator>Enagon</dc:creator>
      <dc:date>2025-03-26T07:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: can't optain cifs options using RestAPI on pstk 9.16.1.2501</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/460001#M7051</link>
      <description>&lt;DIV class=""&gt;In REST, several properties that were present in ZAPI are not available. I have attached a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;cifs&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;option property mapping doc that lists the parameters along with their corresponding REST properties. If a property has "No REST Equivalent," it indicates that it is not available in REST. The following properties—MaxOpensSameFilePerTree, MaxSameTreeConnectPerSession, MaxSameUser SessionsPerConnection, MaxWatchesSetPerTree, IsDacEnabled, IsShadowcopyEnabled, and IsExportpolicyEnabled—are currently missing in PSTK but will be included in an upcoming release.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Apr 2025 10:19:08 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/can-t-optain-cifs-options-using-RestAPI-on-pstk-9-16-1-2501/m-p/460001#M7051</guid>
      <dc:creator>saharsh</dc:creator>
      <dc:date>2025-04-08T10:19:08Z</dc:date>
    </item>
  </channel>
</rss>

