NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

ONTAP Discussions

Script creation for all snapshots for all volumes in the cluster

joshid4
2,722 Views

Hi Team,

 

I am looking for a script via which I can list snapshots on all volumes in a cluster/vserver.

I am new to scripting, hence looking for your guidance and support.

Kindly help and let me know if this can be done.

 

1 ACCEPTED SOLUTION

Ontapforrum
2,707 Views

Using ONTAP PowerShell Module, simplest one:
PS C:\> Get-NcSnapshot | Export-Csv "C:\temp\$($filer).snapshots.csv"

 

Selected fields:
PS C:\> Get-NcSnapshot | Select Name,Volume,Vserver | Export-Csv "C:\temp\$($filer).snapshots.csv"

 

Just look up in the netapp forum, there are many examples (for automation)  not just limited to PS. One such basic PS thread example  is this:
https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Script-to-list-snapshot-copies-of-all-volumes/td-p/24484

 

Related:

https://www.netapp.com/pdf.html?item=/media/16861-tr-4475pdf.pdf
https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/NetApp-PowerShell-Toolkit-9-11-1-2208-released/m-p/437915

View solution in original post

3 REPLIES 3

Ontapforrum
2,708 Views

Using ONTAP PowerShell Module, simplest one:
PS C:\> Get-NcSnapshot | Export-Csv "C:\temp\$($filer).snapshots.csv"

 

Selected fields:
PS C:\> Get-NcSnapshot | Select Name,Volume,Vserver | Export-Csv "C:\temp\$($filer).snapshots.csv"

 

Just look up in the netapp forum, there are many examples (for automation)  not just limited to PS. One such basic PS thread example  is this:
https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Script-to-list-snapshot-copies-of-all-volumes/td-p/24484

 

Related:

https://www.netapp.com/pdf.html?item=/media/16861-tr-4475pdf.pdf
https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/NetApp-PowerShell-Toolkit-9-11-1-2208-released/m-p/437915

joshid4
2,578 Views

I believe this is just to list the snapshots under the cluster.

However, I would need to understand this from very beginning.

For example: Logging into the cluster via providing the IP address and having the script authenticated.

Then logging into the cluster and listing the snapshots.

Ontapforrum
2,576 Views

Therefore, I had provided the links. Please see TR-4475, it covers everything from beginning, concept to installation steps.

Public