Microsoft Virtualization Discussions

Created object on get-NaSnapsot Powershell 4.1 dissapeared




I have one Powershell code to delete old snapshots: Get-Navol | Get-NaSnapshot | where-object {$ -like "smo_*" -and $_.created -lt $3days} | Remove-NaSnapshot -Confirm


My storage is FAS8020 7-mode 8.2.2P2 and after upgrade the powershell toolkit to version 4.1 de .created object was dissapear.


Who can I do the same with the new version of Powershell or where can I download the old version of toolkit?


Best regards




Can you give any more details?


  • Does "Get-NaVol" return all expected volumes?
  • Does "Get-NaVol | Get-NaSnapshot" return all expected snapshots?
  • Does the filter for '$_.Name -like "smo_*"' return the exected values?
  • Does the filter for '$_.Created -lt $3days' return the expected values?
  • What is the value of "$3days"?

In particular, for the last two it would be helpful to know if they work separately...i.e. just use one at a time for the testing. 



If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.


This is the complete script


#Variable of date type which is 3 days before the current date

$3days = (get-date).adddays(-3)


#Get list of all snapshots older than 3 days and delete them 

Get-Navol | Get-NaSnapshot | where-object {$ -like "smo_*" -and $_.created -lt $3days} | Remove-NaSnapshot -Confirm


It was working properly until the upgrade.





Could you also tell us which version of Data ONTAP PowerShell Toolkit you were using before this?


I tried with the same scenario and was able to achieve the deletion of snapshots. I have tried with just 1 day earlier snapshots, as I dont have very old snapshots. Below are the images for reference.


#Variable of date type which is 1 day before the current date

$1day = (get-date).adddays(-1)








As seen in the images, the snapshots were deleted successfully.


NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner