<?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: I need help with PowerShell command &amp;quot; Get-NcSnapshot -SnapName *Veeam* | Set-NcSnapshot -Sn in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/459198#M44783</link>
    <description>&lt;P&gt;Unfortunately, I can't teach you PowerShell to trap the error. Basic thing is your script is calling Get-NcSnapshot somewhere and you need to trap the output first time and try again. Something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$Variable = Get-NcSnapshot &amp;lt;your_volume_name&amp;gt;&lt;BR /&gt;if ($Variable -Match "Bad Request") {&lt;BR /&gt;Write-Host "Trying again"&lt;BR /&gt;Get-NcSnapshot &amp;lt;your_volume_name&amp;gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Mar 2025 01:36:43 GMT</pubDate>
    <dc:creator>Sanaman</dc:creator>
    <dc:date>2025-03-07T01:36:43Z</dc:date>
    <item>
      <title>I need help with PowerShell command " Get-NcSnapshot -SnapName *Veeam* | Set-NcSnapshot -Snapmirror"</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/459103#M44765</link>
      <description>&lt;P&gt;I have a powershell script that has been working well for the past 4 yrs., Recently I migrated the script to a new environment and it started giving errors&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what the script does is to login the source filer&amp;nbsp; A, change the snapshots' snapmirror labels to "daily" then snapvault these snapshots to the destination filer&amp;nbsp; B&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i run it, it seems the script is able to login both filer A and filer B, and replicate the snapshots over. It failed on getting the snapshots,&amp;nbsp; and gave me 400 errors are below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS C:\Users\adm_gwen&amp;gt; powershell.exe E:\Scripts\Veeam-NetAppSnaplock\Set-SM-Label-Update_SV-With-File_Input.ps1 -PrimaryCluster "PUG3AXRSTR1.pue1m.ad" -PrimarySVM "PUG3AXRSTR1-vs01" -ClusterUser veeam -ClusterPass "E:\Scripts\Veeam-NetAppSnaplock\password.txt" -PassKey "E:\Scripts\Veeam-NetAppSnaplock\AES.key" -SecondaryCluster "pcs1bxdsbr.pcs1m.ad" -SecondarySVM "pcs1bxdsbr-uge-vs01" -VolumeListFile "E:\Scripts\Veeam-NetAppSnaplock\SiteA_pug3axrstr_oasys.txt"&lt;BR /&gt;[04.03.2025 15:01:22] Starting new log file&lt;BR /&gt;[04.03.2025 15:01:22] Trying to load NetApp Powershell module&lt;BR /&gt;[04.03.2025 15:01:22] Loaded NetApp Powershell module sucessfully&lt;BR /&gt;[04.03.2025 15:01:22] Trying to connect to SVM PUG3AXRSTR1-vs01 on cluster PUG3AXRSTR1.pue1m.ad&lt;BR /&gt;[04.03.2025 15:01:24] Connection established to PUG3AXRSTR1-vs01 on cluster PUG3AXRSTR1.pue1m.ad&lt;BR /&gt;Get-NcSnapshot : The remote server returned an error: (400) Bad Request.&lt;BR /&gt;At E:\Scripts\Veeam-NetAppSnaplock\Set-SM-Label-Update_SV-With-File_Input.ps1:239 char:3&lt;BR /&gt;+ Get-NcSnapshot -SnapName *Veeam* | Set-NcSnapshot -SnapmirrorLabel ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : NotSpecified: (:) [Get-NcSnapshot], WebException&lt;BR /&gt;+ FullyQualifiedErrorId : System.Net.WebException,DataONTAP.C.PowerShell.SDK.Cmdlets.Snapshot.GetNcSnapshot&lt;/P&gt;&lt;P&gt;[04.03.2025 15:01:24] Trying to connect to SVM pcs1bxdsbr-uge-vs01 on cluster pcs1bxdsbr.pcs1m.ad&lt;BR /&gt;[04.03.2025 15:01:28] Connection established to pcs1bxdsbr-uge-vs01 on cluster pcs1bxdsbr.pcs1m.ad&lt;BR /&gt;[04.03.2025 15:01:28] File E:\Scripts\Veeam-NetAppSnaplock\SiteA_pug3axrstr_oasys.txt was found&lt;BR /&gt;[04.03.2025 15:01:29] Volume tp_pug3axrstr1_vs01_pgu3arj_esx_ds_data_bc_even01_vol was found&lt;BR /&gt;[04.03.2025 15:01:29] SecondarySVM: pcs1bxdsbr-uge-vs01&lt;BR /&gt;[04.03.2025 15:01:29] SecondaryVolume: tp_pug3axrstr1_vs01_pgu3arj_esx_ds_data_bc_even01_vol&lt;BR /&gt;VERBOSE: Updating SnapMirror with destination //pcs1bxdsbr-uge-vs01/tp_pug3axrstr1_vs01_pgu3arj_esx_ds_data_bc_even01_vol.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NcController : pcs1bxdsbr.pcs1m.ad&lt;BR /&gt;ResultOperationId : 76301282-f933-11ef-bcd2-d039eabd3a83&lt;BR /&gt;ErrorCode :&lt;BR /&gt;ErrorMessage :&lt;BR /&gt;JobId :&lt;BR /&gt;JobVserver :&lt;BR /&gt;Status : succeeded&lt;BR /&gt;Uuid :&lt;BR /&gt;Message :&lt;/P&gt;&lt;P&gt;[04.03.2025 15:01:29] Volume tp_pug3axrstr1_vs01_pgu3arj_esx_ds_data_bc_odd01_vol was found&lt;BR /&gt;[04.03.2025 15:01:29] SecondarySVM: pcs1bxdsbr-uge-vs01&lt;BR /&gt;[04.03.2025 15:01:29] SecondaryVolume: tp_pug3axrstr1_vs01_pgu3arj_esx_ds_data_bc_odd01_vol&lt;BR /&gt;VERBOSE: Updating SnapMirror with destination //pcs1bxdsbr-uge-vs01/tp_pug3axrstr1_vs01_pgu3arj_esx_ds_data_bc_odd01_vol.&lt;BR /&gt;NcController : pcs1bxdsbr.pcs1m.ad&lt;BR /&gt;ResultOperationId : 768f5208-f933-11ef-bcd2-d039eabd3a83&lt;BR /&gt;ErrorCode :&lt;BR /&gt;ErrorMessage :&lt;BR /&gt;JobId :&lt;BR /&gt;JobVserver :&lt;BR /&gt;Status : succeeded&lt;BR /&gt;Uuid :&lt;BR /&gt;Message :&lt;/P&gt;&lt;P&gt;[04.03.2025 15:01:30] Volume tp_pug3axrstr1_vs01_pgu3arj_esx_ds_data_nbc_even01_vol was found&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 20:10:39 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/459103#M44765</guid>
      <dc:creator>powershelbeginner</dc:creator>
      <dc:date>2025-03-04T20:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: I need help with PowerShell command " Get-NcSnapshot -SnapName *Veeam* | Set-NcSnapshot -Sn</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/459115#M44768</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From my experience, PSTK throws error when it queries the controller&lt;BR /&gt;Get-NcSnapshot : The remote server returned an error: (400) Bad Request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can recreate the error on my laptop too.&lt;/P&gt;&lt;P&gt;PS C:\Users\user\Scripts&amp;gt; Read-NcDirectory -Path /vol/mystore1 |where-object {$_.Name -Notmatch "\."} |measure-object&lt;BR /&gt;Read-NcDirectory: The remote server returned an error: (400) Bad Request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried again - it works&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PS C:\Users\user\Scripts&amp;gt; Read-NcDirectory -Path /vol/mystore1 |where-object {$_.Name -Notmatch "\."} |measure-object&lt;/P&gt;&lt;P&gt;Count : 47&lt;BR /&gt;Average :&lt;BR /&gt;Sum :&lt;BR /&gt;Maximum :&lt;BR /&gt;Minimum :&lt;BR /&gt;StandardDeviation :&lt;BR /&gt;Property :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, what you can do is, trap that "Bad Request" and retry until no "Bad Request" error then continue.&amp;nbsp; I think it is flow in PSTK 9.15.1.2.xxxx&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 04:32:01 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/459115#M44768</guid>
      <dc:creator>Sanaman</dc:creator>
      <dc:date>2025-03-05T04:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: I need help with PowerShell command " Get-NcSnapshot -SnapName *Veeam* | Set-NcSnapshot -Sn</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/459184#M44780</link>
      <description>&lt;P&gt;Hey Sanaman&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very appreciate your response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got your instructions, could you please tell the commands as I have no idea on how t trap the "Bad Request"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 15:43:38 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/459184#M44780</guid>
      <dc:creator>powershelbeginner</dc:creator>
      <dc:date>2025-03-06T15:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: I need help with PowerShell command " Get-NcSnapshot -SnapName *Veeam* | Set-NcSnapshot -Sn</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/459198#M44783</link>
      <description>&lt;P&gt;Unfortunately, I can't teach you PowerShell to trap the error. Basic thing is your script is calling Get-NcSnapshot somewhere and you need to trap the output first time and try again. Something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$Variable = Get-NcSnapshot &amp;lt;your_volume_name&amp;gt;&lt;BR /&gt;if ($Variable -Match "Bad Request") {&lt;BR /&gt;Write-Host "Trying again"&lt;BR /&gt;Get-NcSnapshot &amp;lt;your_volume_name&amp;gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 01:36:43 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/459198#M44783</guid>
      <dc:creator>Sanaman</dc:creator>
      <dc:date>2025-03-07T01:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: I need help with PowerShell command " Get-NcSnapshot -SnapName *Veeam* | Set-NcSnapshot -Sn</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/459211#M44784</link>
      <description>&lt;P&gt;Great, I think this is good information, I will get it a shot, thanks so much&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 16:35:29 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/459211#M44784</guid>
      <dc:creator>powershelbeginner</dc:creator>
      <dc:date>2025-03-07T16:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: I need help with PowerShell command " Get-NcSnapshot -SnapName *Veeam* | Set-NcSnapshot -Sn</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/460018#M44880</link>
      <description>&lt;P&gt;&lt;SPAN&gt;It seems that you are using PowerShell Toolkit version 9.11.1 or higher. In these versions, the volume parameter is required, so you will need to specify the volume name as well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Use the command as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Get-NcSnapshot -SnapName &amp;lt;snapshot-name&amp;gt; -Volume &amp;lt;volume-name&amp;gt; | Set-NcSnapshot -Snapmirror ...&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2025 10:47:07 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/I-need-help-with-PowerShell-command-quot-Get-NcSnapshot-SnapName-Veeam-Set/m-p/460018#M44880</guid>
      <dc:creator>saharsh</dc:creator>
      <dc:date>2025-04-09T10:47:07Z</dc:date>
    </item>
  </channel>
</rss>

