Working with Netapp snapshots via PowerShell, cluster mode

Connect-NcController anystor

Get-Ncvol -Vserver anysrv -Name anyvol | Get-NcSnapshot | Format-Table -Wrap -AutoSize

$DateToCompare = (Get-date).AddDays(-2)

Get-Ncvol -Vserver anyvsrv -Name anyvol | Get-NcSnapshot | Where-Object {$_.created -lt $DateToCompare -and $_.Name -Notlike “*snapmirror*”}  | remove-ncsnapshot -WhatIf | Format-Table -Wrap -AutoSize

Getting the Netapp Data ONTAP PowerShell toolkit to work

http://mysupport.netapp.com/NOW/download/tools/powershell_toolkit/

PS C:\tmp\ps> Add-NaCredential -Controller anystor -Credential (Get-Credential)

PS C:\tmp\ps> Connect-NaController anystor

WARNING: Use Connect-NcController for Data ONTAP Cluster-mode.

Name                 Address           Vserver              Version

—-                 ——-           ——-              ——-

anystor           0.0.0.0                           NetApp Release 8.2.1 Cluster-Mode: Fri Mar 21 18:39:00 P…