<?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 Query in General Discussion</title>
    <link>https://community.netapp.com/t5/General-Discussion/PowerShell-Query/m-p/167933#M1263</link>
    <description>&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually i suspect the issue is caused by the CIFS server name being in uppercase whereas the SVM name in ONTAP is lowercase. For example if you wanted to query a cluster for all SVM's that were running CIFS and display the volume names (excluding the root volume)...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$cluster     = Read-Host -Prompt "Please enter the cluster name or IP Address"
$credentials = Get-Credential -Credential admin
Connect-NcController -Name $cluster -HTTPS -Credential $credentials | Out-Null
$svms = Get-NcCifsServer
ForEach($svm in $svms.CifsServer){
   $volumes = Get-NcVol -VserverContext $($svm.ToLower())
   ForEach($volume In $volumes){
      If($volume.JunctionPath -ne "/"){
         Write-Host $($volume.Vserver + "," + $volume.Name)
      }
   }
}&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;Please enter the cluster name or IP Address: cluster1.testlab.local
vserver1,cifs_data_001
vserver1,cifs_data_002
vserver1,cifs_data_003&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jun 2021 00:16:45 GMT</pubDate>
    <dc:creator>mbeattie</dc:creator>
    <dc:date>2021-06-21T00:16:45Z</dc:date>
    <item>
      <title>PowerShell Query</title>
      <link>https://community.netapp.com/t5/General-Discussion/PowerShell-Query/m-p/167930#M1261</link>
      <description>&lt;P&gt;Hello, I have a PowerShell Script&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$source_vservers = Get-NcCifsServer -Controller $src&lt;BR /&gt;$source_vservers = $source_vservers.CifsServer&lt;/P&gt;&lt;P&gt;ForEach ($source_vserver in $source_vservers) {&lt;/P&gt;&lt;P&gt;Get-NcVol -Controller $src -VserverContext $source_vserver&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got allways this output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Get-NcVol : Specified vserver not found&lt;BR /&gt;In Zeile:6 Zeichen:1&lt;BR /&gt;+ Get-NcVol -Controller $src -VserverContext $source_vserver&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I check the $source_vserver, I got an output from one SVM.&lt;/P&gt;&lt;P&gt;When I set the $source_verserver = "SVMname", the command works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone an idea how can i fix the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 10:21:18 GMT</pubDate>
      <guid>https://community.netapp.com/t5/General-Discussion/PowerShell-Query/m-p/167930#M1261</guid>
      <dc:creator>Alex78</dc:creator>
      <dc:date>2025-06-04T10:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Query</title>
      <link>https://community.netapp.com/t5/General-Discussion/PowerShell-Query/m-p/167932#M1262</link>
      <description>&lt;P&gt;Hi Alex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try something like this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$cluster     = Read-Host -Prompt "Please enter the cluster name or IP Address"
$credentials = Get-Credential -Credential admin
Connect-NcController -Name $cluster -HTTPS -Credential $credentials
$svms = Get-NcCifsServer
ForEach($svm in $svms.CifsServer){
   Get-NcVol -VserverContext $svm.Name
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jun 2021 23:48:15 GMT</pubDate>
      <guid>https://community.netapp.com/t5/General-Discussion/PowerShell-Query/m-p/167932#M1262</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2021-06-20T23:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Query</title>
      <link>https://community.netapp.com/t5/General-Discussion/PowerShell-Query/m-p/167933#M1263</link>
      <description>&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually i suspect the issue is caused by the CIFS server name being in uppercase whereas the SVM name in ONTAP is lowercase. For example if you wanted to query a cluster for all SVM's that were running CIFS and display the volume names (excluding the root volume)...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$cluster     = Read-Host -Prompt "Please enter the cluster name or IP Address"
$credentials = Get-Credential -Credential admin
Connect-NcController -Name $cluster -HTTPS -Credential $credentials | Out-Null
$svms = Get-NcCifsServer
ForEach($svm in $svms.CifsServer){
   $volumes = Get-NcVol -VserverContext $($svm.ToLower())
   ForEach($volume In $volumes){
      If($volume.JunctionPath -ne "/"){
         Write-Host $($volume.Vserver + "," + $volume.Name)
      }
   }
}&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;Please enter the cluster name or IP Address: cluster1.testlab.local
vserver1,cifs_data_001
vserver1,cifs_data_002
vserver1,cifs_data_003&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 00:16:45 GMT</pubDate>
      <guid>https://community.netapp.com/t5/General-Discussion/PowerShell-Query/m-p/167933#M1263</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2021-06-21T00:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Query</title>
      <link>https://community.netapp.com/t5/General-Discussion/PowerShell-Query/m-p/167934#M1264</link>
      <description>&lt;P&gt;Thank you very much.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have found another solution, which works better:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Get-NcVserver -Controller $src | Where { $_.AllowedProtocols -eq "cifs" }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 07:55:40 GMT</pubDate>
      <guid>https://community.netapp.com/t5/General-Discussion/PowerShell-Query/m-p/167934#M1264</guid>
      <dc:creator>Alex78</dc:creator>
      <dc:date>2021-06-21T07:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Query</title>
      <link>https://community.netapp.com/t5/General-Discussion/PowerShell-Query/m-p/167936#M1265</link>
      <description>&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No problem, however please be aware that by default when you create an SVM the allowed protocols attribute will enable all protocols (nfs,cifs,fcp,iscsi,ndmp). The allow protocols field doesn't necessarily mean the CIFS service is actually configured and running on the vserver. If your objective is to show data volumes for SVM's that are running CIFS then using the "Get-NcCifsServer" cmdlet would appropriate. If however you have used the allowed protocols attribute to restrict the SVM's protocols to only the services that are actually running in your environment then that would be a much easier way to filter the results.&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, 21 Jun 2021 08:40:57 GMT</pubDate>
      <guid>https://community.netapp.com/t5/General-Discussion/PowerShell-Query/m-p/167936#M1265</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2021-06-21T08:40:57Z</dc:date>
    </item>
  </channel>
</rss>

