Mukul,
Thanks. I was using the same filter as you were but the problem seems to be
that the leading zero that is shown with the day and month when the
RepresentedPointInTime property is displayed can't be used the property is
being used in a filter.
Here are some PS one liners relevant to this type operation:
* Display all recovery points on the server TestingServer
Get-ProtectionGroup -DPMServerName TestingServer | %{Get-Datasource
-ProtectionGroup $_} | %{Get-RecoveryPoint -Datasource $_}
* Display all recovery points on the server TestingServer for the protection
group TestProtectionGroup
Get-ProtectionGroup -DPMServerName TestingServer | where {$_.FriendlyName
-eq "TestProtectionGroup"} | %{Get-Datasource -ProtectionGroup $_} |
%{Get-RecoveryPoint -Datasource $_}
* Display only the recovery point on the server TestingServer for the
protection group TestProtectionGroup for a specific time (day and month
values can't have leading zeros)
Get-ProtectionGroup -DPMServerName TestingServer | where {$_.FriendlyName
-eq "TestProtectionGroup"} | %{Get-Datasource -ProtectionGroup $_} |
%{Get-RecoveryPoint -Datasource $_} | where {$_.RepresentedPointInTime -eq
"3/5/2008 6:00:42 PM"}
* Delete only the recovery point on the server TestingServer for the
protection group TestProtectionGroup for a specific time
Get-ProtectionGroup -DPMServerName TestingServer | where {$_.FriendlyName
-eq "TestProtectionGroup"} | %{Get-Datasource -ProtectionGroup $_} |
%{Get-RecoveryPoint -Datasource $_} | where {$_.RepresentedPointInTime -eq
"3/5/2008 6:00:42 PM"} | %{Remove-RecoveryPoint $_}
Post by Mukul Shekhawat [MSFT]Hi Owen,
Here is the complete example cmdlets for your case, these are working fine.
I have verified these on my system.
$pg = Get-ProtectionGroup -DPMServerName TestingServer
$ds = Get-Datasource -ProtectionGroup $pg
$rp = Get-RecoveryPoint -Datasource $ds | where
{$_.RepresentedPointInTime -eq "3/6/2008 10:07:27 PM"}
remove-recoverypoint $rp
make sure you are passing correct $pg and $ds here. As if your system has
more than one PG or more than one DS protected you need to filter them also.
do let me know if you require more info.
Thanks,
Mukul
This posting is provided "AS IS" with no warranties, and confers no
rights.
Post by OwenCVikash,
Thanks for the response.
I tried creating a filter on RepresentedPointInTime but it doesn't work.
This the value that I actually want to filter on. I used a filter of
<where-object {$_.RepresentedPointInTime -eq "05/03/2008 6:00:42 PM"}>.
This time is an exact copy of what is displayed as one of the values for
the RepresentedPointInTime property.
Please post an example filter on RepresentedPointInTime so that I can see
how to implement it. I also tried using the UtcRepresentedPointInTime
property.
Owen
Post by Vikash Jain [MSFT]You can filter out recovery points which you want to remove
Say if you want to remove all disk based recovery point then you could do
something like
$rp = get-recoveryPoint -Datasource $ds
$myrp = $rp | where-object {$_.Datalocation -eq "Disk"}
remove-recoverypoint $myrp
or you can also filter based on the RepresentedPointInTime (i.e the
backup time for a recovery source)
you could filter and get all the recovery points whose
RepresentedPointInTime is less than today - 7 to get all the Point In
Times which are more than a week old
Thanks,
Vikash
This posting is provided "AS IS" with no warranties, and confers no
rights.
get-recoveryPoint -Datasource $ds | where-object {
Post by OwenCI want to manage the deletion of recovery points using a script. I see
an example of how I can use the following PS script to remove all
recovery points but I have been unable to create a filter to uniquely
identify a specific recovery point to delete.
EXAMPLE 1
$pg = Get-ProtectionGroup -DPMServerName TestingServer
$ds = Get-Datasource -ProtectionGroup $pg
$rp = Get-RecoveryPoint -Datasource $ds
Remove-RecoveryPoint -RecoveryPoint $rp
This command removes all the recovery points for a data source.
What property is used as the unique ID for a recovery point?
Owen