DPM 2012 R2 Get-Datasource returns Invalid LatestRecoveryPoint

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?

January 12th, 2015 6:01am

This blog explains the behaviour:

http://blogs.technet.com/b/dpm/archive/2010/09/11/why-good-scripts-may-start-to-fail-on-you-for-instance-with-timestamps-like-01-01-0001-00-00-00.aspx

"Get-DataSource cmdlet which returns data source objects. Data source objects have properties like OldestRecoverypoint, LatestRecoverypoint and TotalRecoverypoints that are useful for SLA and other monitoring purposes. However these properties are computed asynchronously and signal an event when done at which point property values are valid. This means when the Get-Datasource cmdlet returns objects, their property values may not all have computed yet."

Free Windows Admin Tool Kit Click here and download it now
January 26th, 2015 6:25am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics