I'm running the following code in DPM 2021 R2 Powershell (Admin Mode):
ForEach($Memberin$ProtectionGroup) { Get-Datasource-ProtectionGroup$Member|Where{$_.LatestRecoveryPoint -le(Get-Date).adddays(-2)} |SelectComputer,Name,LatestRecoveryPoint|SortComputer|export-csv-append"SOMEFILENAME"}
When I run this code for the first time, I get the following results:
Computer Name LatestRecoverPoint
---------- ------- ----------------------
Server1 C Drive 1/01/0001 12:00:00 AM
When I run the script the second time I get the following results
Computer Name LatestRecoverPoint
---------- ------- ----------------------
Server1 C Drive 6/01/2015 0:00
What I want to know is, has anyone come across this issue of the LatestRecoveryPoint not being reported properly the first time the script runs and if you have resolved it and how did you do it?