<?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 Simple powershell script to get a snashot total size per volume in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Simple-powershell-script-to-get-a-snashot-total-size-per-volume/m-p/105298#M4352</link>
    <description>&lt;P&gt;I wonder if anyone could post a script that does simple thing - list of volumes per FAS with Snapshot Total size and may be a number of Shapshots per each volume.&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jun 2025 04:15:35 GMT</pubDate>
    <dc:creator>Andrey_y</dc:creator>
    <dc:date>2025-06-05T04:15:35Z</dc:date>
    <item>
      <title>Simple powershell script to get a snashot total size per volume</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Simple-powershell-script-to-get-a-snashot-total-size-per-volume/m-p/105298#M4352</link>
      <description>&lt;P&gt;I wonder if anyone could post a script that does simple thing - list of volumes per FAS with Snapshot Total size and may be a number of Shapshots per each volume.&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 04:15:35 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Simple-powershell-script-to-get-a-snashot-total-size-per-volume/m-p/105298#M4352</guid>
      <dc:creator>Andrey_y</dc:creator>
      <dc:date>2025-06-05T04:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Simple powershell script to get a snashot total size per volume</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Simple-powershell-script-to-get-a-snashot-total-size-per-volume/m-p/105325#M4354</link>
      <description>&lt;P&gt;Hi Andrey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are looking for an output like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Controller          Vserver::Volume               SpaceOccupiedBySnapshot                      TotalSnapshots
----------          ---------------               -----------------------                      --------------
10.238.48.40        aparajir-vvsim-01::vol0       1.8 GB                                                   16
10.238.48.40                  aparajir-vvsim-02::vol0       1.8 GB                                                   16
10.238.48.40                  cifs_vs::cifs_vs0             716.0 KB                                                 10&lt;BR /&gt;10.225.183.84                 vs_inf::vs1_ns                1.6 MB                                                   10&lt;BR /&gt;10.225.183.84                 vs_inf::vs1_ns_mirror0001     1.6 MB                                                   11&lt;/PRE&gt;&lt;P&gt;script below ought to do the trick&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$controllers = @{ &lt;BR /&gt;"10.238.48.40" = $credential1&lt;BR /&gt;"10.225.183.84" = $credential2&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;foreach ($controller in $controllers.Keys) {&lt;BR /&gt;&lt;BR /&gt; $conn = Connect-NcController $controller -Credential $controllers[$controller]&lt;BR /&gt;&lt;BR /&gt; $vols = Get-NcVol&lt;BR /&gt; foreach ($vol in $vols) {&lt;BR /&gt; $measure = Get-NcSnapshot $vol.Name | Measure-Object Total -Sum&lt;BR /&gt; $op = New-Object psobject&lt;BR /&gt; Add-Member -InputObject $op -Name Controller -MemberType NoteProperty -Value $global:CurrentNcController.Name&lt;BR /&gt; $volName = $vol.Vserver + "::" + $vol.Name&lt;BR /&gt; Add-Member -InputObject $op -Name "Vserver::Volume" -MemberType NoteProperty -Value $volName&lt;BR /&gt; $totalSpace = ConvertTo-FormattedNumber $measure.Sum DataSize "0.0"&lt;BR /&gt; Add-Member -InputObject $op -Name SpaceOccupiedBySnapshot -MemberType NoteProperty -Value $totalSpace&lt;BR /&gt; Add-Member -InputObject $op -Name TotalSnapshots -MemberType NoteProperty -Value $measure.Count&lt;BR /&gt; Write-Output $op&lt;BR /&gt; }&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This script is for Clustered DataONTAP. If you are running a 7-mode controller, it shouldn't be too difficult to adapt this. Also, if you are interested in a report, you may want to output as CSV, rather than creating an output object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Aparajita&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2015 09:36:28 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Simple-powershell-script-to-get-a-snashot-total-size-per-volume/m-p/105325#M4354</guid>
      <dc:creator>Aparajita</dc:creator>
      <dc:date>2015-05-21T09:36:28Z</dc:date>
    </item>
  </channel>
</rss>

