ONTAP Discussions

Script creation for all snapshots for all volumes in the cluster

joshid4
1,449 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
1,434 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
1,435 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
1,305 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
1,303 Views

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

Public