Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

RestoreLocation parameter for restoreo2k.asp

Created: 20 Jun 2013 | 13 comments

If I call the following link it restores the archived email to my "restored items" folder

http://lonkvs02.freshfieldsbruckhaus.com/Enterpris...

 

If I try to restore it using the restorelocation parameter it fails:

&RestoreLocation=Restored Items
&RestoreLocation=Inbox

 

What am I doing it wrong?

Operating Systems:

Comments 13 CommentsJump to latest comment

GabeV's picture

Are you trying to restore items from Outlook, OWA, ArchiveExplorer, search? what interface?

“Success is not final, failure is not fatal: it is the courage to continue that counts.”–Winston Churchill

GabeV's picture

Spiker,

It appears that this parameter is an integer and under foldername you should have the folder to restore the archived item:

restorelocation=3&foldername=Deleted%20Items

This parameter seems to be handled by EV internally. I am not sure if you would be able to call restoreo2k using your own parameters.

“Success is not final, failure is not fatal: it is the courage to continue that counts.”–Winston Churchill

spiker's picture

I am trying to call restore02k.asp directly via code.

It works fine if I dont put in the &RestoreLocation= parameter and the item gets restored to my "restored items" exchange folder.

By looking at the restore02k.asp sourcecode it appears to expect RestoreLocation to be a long. i.e.

' If we have been passed a Restore Location we will use that
lRestoreLocation = request.QueryString("RestoreLocation")
 
' Otherwise we will use the Webapp.ini setting
if(IsEmpty(lRestoreLocation)) then
   <not being called as I am actually passing it>
else
lRestoreLocation = CLng(lRestoreLocation)  'we ensure that it is a numeric value if not empty
 
 
However, I am not sure what numeric value it is expecting that corresponds to a folder?
 

 

 

 

GabeV's picture

Looking at the ASP page, this variable seems to contain some kind of constant or internal value handled by EV. On this snippet, the ASP code compares lRestoreLocation with dvseRestoreBasketCustomLocation:

    ...

    lRestoreLocation = CLng(lRestoreLocation)  'we ensure that it is a numeric value if not empty
    
    if( lRestoreLocation = dvseRestoreBasketCustomLocation ) then
        strCustomLocationPVID = request.QueryString("CustomLocationPVID")
    end if

    ...

I don't think the RestoreLocation value is related to a specific folder in the archive. Although you shouldn't be recalling items directly from the code, I'd give a try with a value of 3 and a different foldername parameter.

Let me know if helps.

“Success is not final, failure is not fatal: it is the courage to continue that counts.”–Winston Churchill

spiker's picture

thanks for the comments

 

The only values that don't appear to error when passed in for RestoreLocation are 1,2 and 3.
I will try your suggestion but what does the value of 3 represent?

GabeV's picture

Spiker,

Take a look at the DVS.INC file on your EV server, webapp folder:

  '
  ' The settings for where to restore a basket to.
  '
  const dvseRestoreBasketOriginalLocation = 0
  const dvseRestoreBasketRestoredItems = 1
  const dvseRestoreBasketPST = 2
  const dvseRestoreBasketOWA = 3
  const dvseRestoreBasketCustomLocation = 4

 

“Success is not final, failure is not fatal: it is the courage to continue that counts.”–Winston Churchill

spiker's picture

thanks

I will try tomorrow and feedback on the outcome

spiker's picture

This doesn't appear to be working (perhaps because I am populating the folder name wrong, maybe it has to be referenced from the mailbox root?)

It would be interesting to see what is happening for this piece of code (in bold)

if lRestoreLocation = dvseRestoreBasketRestoredItems then
  objBasket.RestoredItemsName = dvwMessages("dvwsRestoredItemsFolderName")
elseif lRestoreLocation = dvseRestoreBasketOWA then
  objBasket.RestoredItemsName = Request.QueryString("foldername")
end if
 
 
i.e. what does dvwMessages("dvwsRestoredItemsFolderName") return? Then I could modify the same format for a different foldername via the foldername parameter.
Rob.Wilcox's picture

You could also try for ClientAction.asp, and decode what's needed for that.

spiker's picture

Just noiced if I restore via archive explorer to a chosen folder it first calls:

http://xxx/EnterpriseVault/FolderPicker.asp?folderpicker=true&allowmultiselect=false&subfoldercheckbox=false&archivetypefilter=45&archiveidfilter=xxx
 
The above only shows folders that archive vault knows about. if I create a new exchange folder it won't be in that list until EV becomes SYNC'd.
 
and then it calls
 
http://xxx/EnterpriseVault/restoreo2k.asp?VaultID=xxx&SavesetID=xxx&Restoring=1&RestoreLocation=4&CustomLocationPVID=xxx&mbx=xxx&server=xxx
 
 
Not sure where it gets the following value from
&CustomLocationPVID=1EC8903D59CF3834E938F240F912D4A051110000FFKVAULT
 
 
Is there no way of just passing in an exchange folder name and getting it to restore to that location?
 
 
JesusWept3's picture

PVID would be the VaultID , as in the VaultID

So you would get the PVID from a query like

SELECT R.VaultEntryId
FROM Root R, ArchiveFolder AF
WHERE R.RootIdentity = AF.RootIdentity
AND AF.FolderName = 'myFolder'

spiker's picture

thanks

And how would I get all the folders for a particular user?
Then I could create a tree and allow the user to select a folder to restore an email to.

Then i would call restoreo2 with restorelocation=4&customlocationpvid=<selected folder pvid>

spiker's picture

I was able to get the list of EV recorded folders for a user via:

SELECT AF.folderName, R.RootIdentity, AF.ParentFolderRootIdentity, R.VaultEntryId FROM Root R 
INNER JOIN ArchiveFolder AF ON R.RootIdentity = AF.RootIdentity 
WHERE R.ContainerRootIdentity = (SELECT top 1 R.RootIdentity FROM ExchangeMailboxEntry eme INNER JOIN Root R ON eme.DefaultVaultId = R.VaultEntryId WHERE eme.MbxNTUser ='xxx')
 
I could then generate a tree from the information returned above
To restore the item I would then execute:
 
http://xxx/EnterpriseVault/restoreo2k.asp?VaultID=xxx&SavesetID=xxx&mbx=SMTP:xxx@xxx.com&server=xxx&restorelocation=4&CustomLocationPVID=<vaultentryid of selected folder from above SQL query>