<?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: get-nasnapshot with last dated snapshot in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42690#M2028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't sort by the "Created" property. It does not sort the column as dates, but rather as strings. So, you'll see something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1/13/2012&lt;/P&gt;&lt;P&gt;1/9/2012&lt;/P&gt;&lt;P&gt;1/12/2012&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead, sort by the "AccessTime" property. This property does not seem to change when you create a flexclone from the snapshot, so I'm not sure why it's named "AccessTime". But either way, it's the number of seconds since Epoch, so it's pretty easy to sort by.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jan 2012 16:21:29 GMT</pubDate>
    <dc:creator>drdabbles</dc:creator>
    <dc:date>2012-01-20T16:21:29Z</dc:date>
    <item>
      <title>get-nasnapshot with last dated snapshot</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42668#M2024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm writing a powershell script and i need to get the names of the last snapshots which are sent to dr site with snapmirror i'm trying to automate the disaster recovery scenario.&lt;/P&gt;&lt;P&gt;basic concept is finding the last snapshot name, create a volume flexclone from the snapshot and map the clone luns to a esxi server.&lt;/P&gt;&lt;P&gt;i cannot get the date values of the snapshots so i'm not able to create flexclones with them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any help will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;T.S. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:39:51 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42668#M2024</guid>
      <dc:creator>tsentekin</dc:creator>
      <dc:date>2025-06-05T06:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: get-nasnapshot with last dated snapshot</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42673#M2025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Connect-NaController &lt;EM&gt;controller&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;$latestSnap = Get-NaSnapshot -TargetName &lt;EM&gt;volume | &lt;/EM&gt;? { $_.Name -imatch "&lt;EM&gt;snapshot root name"&lt;/EM&gt; } | Sort-Object AccessTimeDT -Descending | Select-Object -first 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where snapshot root name is the name of the snapshots you are creating.&amp;nbsp; You want to filter out the automatically generated snapshots created by Snapmirror (assuming you are using SM).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2011 21:56:01 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42673#M2025</guid>
      <dc:creator>bsti</dc:creator>
      <dc:date>2011-12-12T21:56:01Z</dc:date>
    </item>
    <item>
      <title>get-nasnapshot with last dated snapshot</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42681#M2026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Get-NaSnapshot cmdlet should return snapshot objects that include the creation time of the snapshot.&amp;nbsp; This property is named "Created" and is of type System.DateTime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here is some sample code:&lt;/P&gt;&lt;P&gt;$vols = Get-NaVol | Sort-Object -Property "Name"&lt;/P&gt;&lt;P&gt;foreach ($vol in $vols) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; write-host "Processing $vol"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $snapshots = $null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $snapshots = Get-NaSnapshot -TargetName $vol.name | Sort-Object -Property "Created"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $vol | Add-Member -Name "Snapshots" -MemberType "NoteProperty" -Value $snapshots&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This will get all the volumes on the connected NetApp.&amp;nbsp; The list will be sorted by name.&amp;nbsp; Then, for each volume, the list of snapshots is gathered and sorted by the "Created" property.&amp;nbsp; The list of snapshots is then added as a new member property of the volume object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, the $vols object contains an array of volumes (or a single volume if only one volume exists).&amp;nbsp; Each volume object contains a property named "Snapshots."&amp;nbsp; If the volume contained no snapshots (or if the Get-NaSnapshot commandlet encountered an error), the Snapshots property will be $null.&amp;nbsp; If the volume contained snapshots, the array of snapshots (or a single snapshot object if only one existed) will be stored in that property.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you want the last snapshot object for a volume, the command would look like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$volname = &amp;lt;name_of_volume_from_which_you_want_to_make_the_clone&amp;gt;&lt;BR /&gt;$volCloneParent = $vols | Where-Object {$_.name -eq $volname"}&lt;/P&gt;&lt;P&gt;$snapshots = $volCloneParent.Snapshots&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$newestSnapshot = $snapshots[$snapshots.count-1]&lt;BR /&gt;$oldestSnapshot = $snapshots[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know whether this answers your question.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Bill&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 20:35:49 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42681#M2026</guid>
      <dc:creator>paleon</dc:creator>
      <dc:date>2011-12-14T20:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: get-nasnapshot with last dated snapshot</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42686#M2027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to everyone,especially to &lt;STRONG style="font-size: 12px; font-family: Arial, Helvetica, Verdana, sans-serif; color: #454545; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.netapp.com/bsti@plex.com" id="jive-93262029579853747677" style="padding-right: 3px; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0067c5; text-decoration: underline;" target="_blank"&gt;bsti@plex.com&lt;/A&gt;&lt;/STRONG&gt; now i think i can complete my script. cheers everyone:))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T.S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2011 21:16:43 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42686#M2027</guid>
      <dc:creator>tsentekin</dc:creator>
      <dc:date>2011-12-15T21:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: get-nasnapshot with last dated snapshot</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42690#M2028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't sort by the "Created" property. It does not sort the column as dates, but rather as strings. So, you'll see something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1/13/2012&lt;/P&gt;&lt;P&gt;1/9/2012&lt;/P&gt;&lt;P&gt;1/12/2012&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead, sort by the "AccessTime" property. This property does not seem to change when you create a flexclone from the snapshot, so I'm not sure why it's named "AccessTime". But either way, it's the number of seconds since Epoch, so it's pretty easy to sort by.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2012 16:21:29 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42690#M2028</guid>
      <dc:creator>drdabbles</dc:creator>
      <dc:date>2012-01-20T16:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: get-nasnapshot with last dated snapshot</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42695#M2030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of the recent versions of the PoSH Toolkit also reports the AccessTimeDT property, which is AccessTime translated to a GMT datetime.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2012 17:32:40 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-nasnapshot-with-last-dated-snapshot/m-p/42695#M2030</guid>
      <dc:creator>bsti</dc:creator>
      <dc:date>2012-01-20T17:32:40Z</dc:date>
    </item>
  </channel>
</rss>

