I'm running into an issue where snapshots older than the Snapcenter retention period are not always removed, and I would like to run a powershell script to check for these (and possibly delete anything older. )
This is SQL server FC attached vols, and the SnapCenter workflow is 1) full-backup with 7 days retention -> 2) snapmirror copy also with 7 days retention -> 3) snapvault copy to a separate aggr with 14 days retention.
To check the snapshot dates in chronological order, I am running:
Get-NcSnapshot | Where-Object {$_.Volume -match 'sql_srv_volx'} | Sort-object -property Created
This is reporting all dates for the relevant volumes, but is it possible to show the oldest snapshot only? I've tried variations of -CreateTime >7days, but must be doing something wrong.