Hello @ahmada,
Here is one version, though you could do a rudimentary check beforehand to see if the number of snapshots taken at the desired time matches the number of volumes. If they don't match, then start looking for the volumes which are missing a snapshot.
# the reference time which we want to have a snapshot taken at
# this will return an object referencing yesterday at 8pm
$refTime = [DateTime]::Today.AddDays(-1).AddHours(20)
# get only volumes with the snapshot policy we want
Get-NcVol -Query @{ VolumeSnapshotAttributes = @{ SnapshotPolicy = "default" } } | ForEach-Object {
# get snapshots for the volume which match the reference time
if ( ($_ | Get-NcSnapshot | Where-Object { $_.AccessTimeDT -eq $refTime }).count -ne 1) {
# if there wasn't one returned, state so in red
Write-Host -ForegroundColor Red "Volume $($_.Name) does not have a snapshot at the reference time"
} else {
# there was one returned, say so in green
Write-Host -ForegroundColor Green "Volume $($_.Name) has a snapshot at the reference time"
}
}
Note that this is for Clustered ONTAP. The 7-mode cmdlets used will be slightly different (I don't have a 7-mode system to test against), but the principle is the same.
Hope that helps.
Andrew
If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.