<?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 Powershell - Get a list of  volumes  that have  not created a snapshot in the last # of hours in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-volumes-that-have-not-created-a-snapshot-in-the-last-of/m-p/151209#M6044</link>
    <description>&lt;P&gt;I am trying to create a powershell script that will give me every volume that has not created a snaphot is the last 2 hours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;get-ncvol | get-ncsnapshot | where-object {$_.createdhour -g 2}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this only give me snapshots creat at 2 am&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 12:13:46 GMT</pubDate>
    <dc:creator>Tmbridges</dc:creator>
    <dc:date>2025-06-04T12:13:46Z</dc:date>
    <item>
      <title>Powershell - Get a list of  volumes  that have  not created a snapshot in the last # of hours</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-volumes-that-have-not-created-a-snapshot-in-the-last-of/m-p/151209#M6044</link>
      <description>&lt;P&gt;I am trying to create a powershell script that will give me every volume that has not created a snaphot is the last 2 hours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;get-ncvol | get-ncsnapshot | where-object {$_.createdhour -g 2}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this only give me snapshots creat at 2 am&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 12:13:46 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-volumes-that-have-not-created-a-snapshot-in-the-last-of/m-p/151209#M6044</guid>
      <dc:creator>Tmbridges</dc:creator>
      <dc:date>2025-06-04T12:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell - Get a list of  volumes  that have  not created a snapshot in the last # of hours</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-volumes-that-have-not-created-a-snapshot-in-the-last-of/m-p/151213#M6045</link>
      <description>&lt;P&gt;I am not an ps expert, but there is way to get to know the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Following simple CLI from clustershell, will return the list of volumes thta have snapshot created in less than 2 hours.&lt;/P&gt;
&lt;P&gt;::&amp;gt; volume snapshot show -create-time &amp;gt;2h&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Basically, if 'no-ouput' that means all the volumes here are candidate, if you do get 'some-output' that means except those rest all are the candidate.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Hopefully, some ps expert could provide you with ps commands you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know this is not efficient but that's all I can think of now.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 15:01:39 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-volumes-that-have-not-created-a-snapshot-in-the-last-of/m-p/151213#M6045</guid>
      <dc:creator>Ontapforrum</dc:creator>
      <dc:date>2019-09-24T15:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell - Get a list of  volumes  that have  not created a snapshot in the last # of hours</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-volumes-that-have-not-created-a-snapshot-in-the-last-of/m-p/151223#M6046</link>
      <description>&lt;P&gt;Try this code:&lt;/P&gt;
&lt;PRE&gt;$vols = Get-NcVol
foreach ($vol in $vols) {
	Get-NcSnapshot | Where-Object { $_.Created -le (Get-Date).AddHours(-2) -and $_.Volume -eq $vol } | Sort-Object AccessTimeDT -Descending | Select-Object -First 1 `
	@{l = "Volume"; e = { $_.Volume } }, @{l = "Snapshot"; e = { $_.Name } }, @{l = "CreatedTime"; e = {$_.Created}}
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used some calculated properties to clean up the output a bit, but you can customize it too if there are additional properties you want to show beyond what I have there.&lt;/P&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;Donny&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 22:14:41 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-volumes-that-have-not-created-a-snapshot-in-the-last-of/m-p/151223#M6046</guid>
      <dc:creator>donny_lang</dc:creator>
      <dc:date>2019-09-24T22:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell - Get a list of  volumes  that have  not created a snapshot in the last # of hours</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-volumes-that-have-not-created-a-snapshot-in-the-last-of/m-p/151282#M6047</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 19:50:32 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Get-a-list-of-volumes-that-have-not-created-a-snapshot-in-the-last-of/m-p/151282#M6047</guid>
      <dc:creator>Tmbridges</dc:creator>
      <dc:date>2019-09-26T19:50:32Z</dc:date>
    </item>
  </channel>
</rss>

