<?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 Happy New Year - &amp;quot;Get-NaSnapshot... | -last 1&amp;quot; returns Dec and not Jan in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Happy-New-Year-quot-Get-NaSnapshot-last-1-quot-returns-Dec-and-not-Jan/m-p/80469#M3934</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The powershell script I use to update my snapvault has stopped working.&amp;nbsp; A brief investigation shows that the snapshot name selection process has failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use the commandlet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;$smeEXsnap = Get-NaSnapshot exdb1 exchsnap__* | select-object Name -last 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;it retuns "exchsnap__exmbx1_12-31-2011_23.40.13__daily"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Snaps on filer&lt;/P&gt;&lt;P&gt;SAN&amp;gt; snap list -n exdb1&lt;/P&gt;&lt;P&gt;Volume exdb1&lt;/P&gt;&lt;P&gt;working...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name&lt;/P&gt;&lt;P&gt;------------&amp;nbsp; --------&lt;/P&gt;&lt;P&gt;Jan 02 23:43&amp;nbsp; exchsnap__exmbx1_01-02-2012_23.40.13__daily&lt;/P&gt;&lt;P&gt;Jan 02 00:01&amp;nbsp; exchsnap__exmbx1_01-01-2012_23.40.14__daily&lt;/P&gt;&lt;P&gt;Jan 01 00:11&amp;nbsp; exchsnap__exmbx1_12-31-2011_23.40.13__daily (snapvault)&lt;/P&gt;&lt;P&gt;Dec 30 23:42&amp;nbsp; exchsnap__exmbx1_12-30-2011_23.40.13__daily&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The work around is simple in that I can manually run my script with the snapshot name to update the snapvaults and then remove the snapshots from last year.&amp;nbsp; But I would like to know if this is a 'bug' in the commandlet or I need to change my code so that 'last' also takes in the year value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bren&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS - Happy new year all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2025 06:38:27 GMT</pubDate>
    <dc:creator>BrendonHiggins</dc:creator>
    <dc:date>2025-06-05T06:38:27Z</dc:date>
    <item>
      <title>Happy New Year - "Get-NaSnapshot... | -last 1" returns Dec and not Jan</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Happy-New-Year-quot-Get-NaSnapshot-last-1-quot-returns-Dec-and-not-Jan/m-p/80469#M3934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The powershell script I use to update my snapvault has stopped working.&amp;nbsp; A brief investigation shows that the snapshot name selection process has failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use the commandlet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;$smeEXsnap = Get-NaSnapshot exdb1 exchsnap__* | select-object Name -last 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;it retuns "exchsnap__exmbx1_12-31-2011_23.40.13__daily"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Snaps on filer&lt;/P&gt;&lt;P&gt;SAN&amp;gt; snap list -n exdb1&lt;/P&gt;&lt;P&gt;Volume exdb1&lt;/P&gt;&lt;P&gt;working...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name&lt;/P&gt;&lt;P&gt;------------&amp;nbsp; --------&lt;/P&gt;&lt;P&gt;Jan 02 23:43&amp;nbsp; exchsnap__exmbx1_01-02-2012_23.40.13__daily&lt;/P&gt;&lt;P&gt;Jan 02 00:01&amp;nbsp; exchsnap__exmbx1_01-01-2012_23.40.14__daily&lt;/P&gt;&lt;P&gt;Jan 01 00:11&amp;nbsp; exchsnap__exmbx1_12-31-2011_23.40.13__daily (snapvault)&lt;/P&gt;&lt;P&gt;Dec 30 23:42&amp;nbsp; exchsnap__exmbx1_12-30-2011_23.40.13__daily&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The work around is simple in that I can manually run my script with the snapshot name to update the snapvaults and then remove the snapshots from last year.&amp;nbsp; But I would like to know if this is a 'bug' in the commandlet or I need to change my code so that 'last' also takes in the year value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bren&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS - Happy new year all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:38:27 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Happy-New-Year-quot-Get-NaSnapshot-last-1-quot-returns-Dec-and-not-Jan/m-p/80469#M3934</guid>
      <dc:creator>BrendonHiggins</dc:creator>
      <dc:date>2025-06-05T06:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Happy New Year - "Get-NaSnapshot... | -last 1" returns Dec and not Jan</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Happy-New-Year-quot-Get-NaSnapshot-last-1-quot-returns-Dec-and-not-Jan/m-p/80474#M3935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am also getting this trouble since I can not include in the year value into result list? Is there any solution to solve that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jan 2012 06:19:14 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Happy-New-Year-quot-Get-NaSnapshot-last-1-quot-returns-Dec-and-not-Jan/m-p/80474#M3935</guid>
      <dc:creator>TRANDUCMILLE</dc:creator>
      <dc:date>2012-01-16T06:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Happy New Year - "Get-NaSnapshot... | -last 1" returns Dec and not Jan</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Happy-New-Year-quot-Get-NaSnapshot-last-1-quot-returns-Dec-and-not-Jan/m-p/80478#M3936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to sort the results by date and then select last 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get-NaSnapshot volname | Sort-Object Created | Select-Object -last 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Mladen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jan 2012 09:35:03 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Happy-New-Year-quot-Get-NaSnapshot-last-1-quot-returns-Dec-and-not-Jan/m-p/80478#M3936</guid>
      <dc:creator>mladen_zecevic</dc:creator>
      <dc:date>2012-01-16T09:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Happy New Year - "Get-NaSnapshot... | -last 1" returns Dec and not Jan</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Happy-New-Year-quot-Get-NaSnapshot-last-1-quot-returns-Dec-and-not-Jan/m-p/80483#M3937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This bug bit me too, because I have scripts that automatically mount snapshots and do some processing for a SQL process I've created. Once the December backups were gone, it started working again. Fortunately, I'd fixed the problem by then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Sort-Object Created" will not work. "Created" is not the actual field name for the date the snapshot was created, even though it's column display name is "Created".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I work around the sorting problem by doing this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;get-nasnapshot -Name volname | Where { $_.Name -like "sqlsnap*" } | Sort-Object AccessTime,Name -descending | Select -Last 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will get me any snapshot named "sqlsnap*", so I'm filtering out the automatic snapshots for my snapmirror process, etc.. Then I sort the object from most recent to least recent by the date the snapshot was created and the name of the snapshot. The name is just in there as a safety measure, I guess. There's little chance that two snapshots could have the same &lt;EM&gt;exact&lt;/EM&gt; creation time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2012 16:09:30 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Happy-New-Year-quot-Get-NaSnapshot-last-1-quot-returns-Dec-and-not-Jan/m-p/80483#M3937</guid>
      <dc:creator>drdabbles</dc:creator>
      <dc:date>2012-01-20T16:09:30Z</dc:date>
    </item>
  </channel>
</rss>

