Hello Asulliva,
using get-nasnapmirror cmdlet we can get the snapmirror detaila and we can filter with lag time more than 24 hours. But it have some issues.
Issue: Get-snapmirror cmdlet doesn't pull the snapmirror relationships which are created from vfiler context. It only pulls the report from vfiler0. Hence any snapmirror which are created from vfiler context are missed. We have tested this functionality.
2nd issue:
I am redirecting the output to an outpu file with the below mentioned commands. If I execute the powershell script using Powershell ISE it works and pull the snapmirror data and redirect to the output file as desired but when it runs through windows scheduler it doesn't redirect the output
powershell scipt used for the following output:
write-ouput "controller name: $controller" | out-file -filepath $out_file -append
write-ouput "=====================" | out-file -filepah $out_file -append
invoke-nassh -name $controller -credentails "$cred" "vfiler run * snapmirror status" | ft -autosize | out-file $out_file -append
NOTE: the above command was also tried using write-output which has also failed to execute the commands
Output when run from powershell ise:
conroller name: src
===============
src:vol1 src2:vol1_sm snapmirrored 00:20:05
src:vol2 src2:vol2_sm snapmirrored 24:20:05
Output when run from the windows scheduler
conroller name: src
===============
NO OUTPUT OF THE COMMANDS RELATED TO SNAPMIRROR HAS BEEN REDIRECTED TO THE OUT_FILE