Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article will walk you through the steps of doing a simple file restore from Windows Powershell. This is the command as listed in TechNet:
Recover-RecoverableItem [-RecoverableItem] <RecoverableObject[]> [-RecoveryOption] <RecoveryOptions> [-RecoveryPointLocation <RecoverySourceLocation[]>] [-JobStateChangedEventHandler <JobStateChangedEventHandler>] [-RecoveryNotification <Nullable`1>] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>]
That looks simple enough but let's take a closer look. First you will need some information to do the recovery.
What you will need:
1. Recoverable Object
2. Recovery Options
3. Recovery Point Location
First we need to get a recoverable object. Easy enough right? Wrong, it requires three variables and those have to be indexed into the get-recoverypoint cmdlet so technically you get two cmdlets for the price of one in this article.
You will be creating three variables
1. $pg = get-protectiongroup –dpmservername dpmserver1
a. This will return an array; assign an index value to the first one you see as 0, the second one will be 1, etc…http://blogs.technet.com/blogfiles/dpmsupport/WindowsLiveWriter/RecoverRecoverableItem_DBA2/clip_image002_thumb_1.jpg
2. $ds = get-datasource –protectiongroup[$pg_arrayindexvaluefromabove]
a. This will return an array
http://blogs.technet.com/blogfiles/dpmsupport/WindowsLiveWriter/RecoverRecoverableItem_DBA2/clip_image004_thumb_1.jpg
3. $rp= get-recoverypoint –datasource[$ds_arrayindexvalue]
http://blogs.technet.com/blogfiles/dpmsupport/WindowsLiveWriter/RecoverRecoverableItem_DBA2/clip_image006_thumb_1.jpg
4. $gr = get-recoverableitem –recoverableitem $rp[0]
http://blogs.technet.com/blogfiles/dpmsupport/WindowsLiveWriter/RecoverRecoverableItem_DBA2/clip_image008_thumb_1.jpg
Once you have the above three variables created you can now determine which recovery point you want to restore. No, we are not done yet but we now have most of the information necessary to perform the recovery. Just a few more variables and we are done.
Let’s look at recover-recoverableitem again. This time we will look at the bare minimum that you will need to get your file restored.
Recover-RecoverableItem [-RecoverableItem] <RecoverableObject[]> [-RecoveryOption] <RecoveryOptions> [-RecoveryPointLocation <RecoverySourceLocation[]>]
Recover-recoverableitem requires 3 pieces of information. We have the recoverable object in the array index value from $rp above.
We also need recovery options ($rop.) This is another variable. It takes information that you input and when the item is recovered, it uses these variables to overwrite the file, restore the file, etc…
http://blogs.technet.com/blogfiles/dpmsupport/WindowsLiveWriter/RecoverRecoverableItem_DBA2/$rop_thumb.png
Once we have the $rop variable we can finally restore the file.
http://blogs.technet.com/blogfiles/dpmsupport/WindowsLiveWriter/RecoverRecoverableItem_DBA2/Captureend_thumb.png
You can see from the above screenshot that we are now in progress of putting the file back where it came from.
Note: This information was originally provided by Walt Whitman on the Data Protection Manager blog:
http://blogs.technet.com/dpm/archive/2010/01/06/recover-recoverable-item.aspx