<?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 command to list snapshot details for particular volumes in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-command-to-list-snapshot-details-for-particular-volumes/m-p/108692#M4470</link>
    <description>&lt;P&gt;There is a number of different ways to do the selector...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# use an array iterator
@("vol1", "vol2", "vol3") | %{ Get-NcVol -Name $_ } | Get-NcSnapshot .......

# use the "in" operator
Get-NcVol | ?{ $_.Name -in @("vol1", "vol2", "vol3") } | Get-NcSnapshot ........

# using a text file, one volume name per line
Get-Content volumes.txt | %{ Get-NcVol -Name $_ } | Get-NcSnapshot .......&lt;BR /&gt;&lt;BR /&gt;# use a wild card match&lt;BR /&gt;Get-NcVol | ?{ $_.Name -like "vol*" } | Get-NcSnapshot .......&lt;BR /&gt;&lt;BR /&gt;# use a wild card exclude&lt;BR /&gt;Get-NcVol | ?{ $_.Name -notlike "root*" } | Get-NcSnapshot .........&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for more specific dates, the DateTime object has parameters for all of the date components...year, month, day, hour, minute, etc. &amp;nbsp;If you want to check for "today", for example, you could do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# Get snapshots created today&lt;BR /&gt;Get-NcSnapshot | ?{ $_.Created.ToShortDateString() -eq (Get-Date).ToShortDateString() }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could also use relative time periods:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# Get snapshots less than 7 days old
Get-NcSnapshot | ?{ $_.Created -gt (Get-Date).AddDays(-7) }

# Get snapshots more than 7 days old
Get-NcSnapshot | ?{ $_.Created -lt (Get-Date).AddDays(-7) }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 15 Aug 2015 17:26:37 GMT</pubDate>
    <dc:creator>asulliva</dc:creator>
    <dc:date>2015-08-15T17:26:37Z</dc:date>
    <item>
      <title>Powershell command to list snapshot details for particular volumes</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-command-to-list-snapshot-details-for-particular-volumes/m-p/108689#M4467</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for&amp;nbsp;Powershell command to list snapshot details for particular volumes. I tried below command but getting o/p for last volume in list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;volumes.txt have identified volume list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;foreach ($volume in Get-Content volumes.txt) { Get-NcSnapshot $volume| select Volume,Name,Created|Export-Csv snapshot.csv }&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Is there any way to list snapshot created only in particular time range ex (9AM to 1PM)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in Advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ram&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 23:31:39 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-command-to-list-snapshot-details-for-particular-volumes/m-p/108689#M4467</guid>
      <dc:creator>RAMACHANDRA_CL</dc:creator>
      <dc:date>2025-06-04T23:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell command to list snapshot details for particular volumes</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-command-to-list-snapshot-details-for-particular-volumes/m-p/108690#M4468</link>
      <description>&lt;P&gt;Hi Ram,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "Created" property is an alias to the AccessTimeDT property, which is a standard PowerShell DateTime object. &amp;nbsp;This means it has properties like "hour" which you can use in your selector. &amp;nbsp;Here is an example which will return all snapshots created between 9am and 1pm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Get-NcVol | Get-NcSnapshot | Where-Object { $_.Created.hour -ge 9 -and $_.Created.hour -le 13 }&lt;/PRE&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Sat, 15 Aug 2015 14:01:10 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-command-to-list-snapshot-details-for-particular-volumes/m-p/108690#M4468</guid>
      <dc:creator>asulliva</dc:creator>
      <dc:date>2015-08-15T14:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell command to list snapshot details for particular volumes</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-command-to-list-snapshot-details-for-particular-volumes/m-p/108691#M4469</link>
      <description>&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply. This works for me..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there any way to get snapshot details for identified volumes instead of all volumes in a filer?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can I get more specific output for example&amp;nbsp;8/15/2015 1 to 3 AM snapshots?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;</description>
      <pubDate>Sat, 15 Aug 2015 14:54:36 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-command-to-list-snapshot-details-for-particular-volumes/m-p/108691#M4469</guid>
      <dc:creator>RAMACHANDRA_CL</dc:creator>
      <dc:date>2015-08-15T14:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell command to list snapshot details for particular volumes</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-command-to-list-snapshot-details-for-particular-volumes/m-p/108692#M4470</link>
      <description>&lt;P&gt;There is a number of different ways to do the selector...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# use an array iterator
@("vol1", "vol2", "vol3") | %{ Get-NcVol -Name $_ } | Get-NcSnapshot .......

# use the "in" operator
Get-NcVol | ?{ $_.Name -in @("vol1", "vol2", "vol3") } | Get-NcSnapshot ........

# using a text file, one volume name per line
Get-Content volumes.txt | %{ Get-NcVol -Name $_ } | Get-NcSnapshot .......&lt;BR /&gt;&lt;BR /&gt;# use a wild card match&lt;BR /&gt;Get-NcVol | ?{ $_.Name -like "vol*" } | Get-NcSnapshot .......&lt;BR /&gt;&lt;BR /&gt;# use a wild card exclude&lt;BR /&gt;Get-NcVol | ?{ $_.Name -notlike "root*" } | Get-NcSnapshot .........&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for more specific dates, the DateTime object has parameters for all of the date components...year, month, day, hour, minute, etc. &amp;nbsp;If you want to check for "today", for example, you could do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# Get snapshots created today&lt;BR /&gt;Get-NcSnapshot | ?{ $_.Created.ToShortDateString() -eq (Get-Date).ToShortDateString() }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could also use relative time periods:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# Get snapshots less than 7 days old
Get-NcSnapshot | ?{ $_.Created -gt (Get-Date).AddDays(-7) }

# Get snapshots more than 7 days old
Get-NcSnapshot | ?{ $_.Created -lt (Get-Date).AddDays(-7) }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Aug 2015 17:26:37 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-command-to-list-snapshot-details-for-particular-volumes/m-p/108692#M4470</guid>
      <dc:creator>asulliva</dc:creator>
      <dc:date>2015-08-15T17:26:37Z</dc:date>
    </item>
  </channel>
</rss>

