10-08-2014 02:57 PM
Hi
EV 9.0.2
I need to use EVSVR to extract 1000s of files.
e.g.
evsvr
interactive
ds 1B12861C18E81BC4DAF1E6A2602E0ECBF1110000vaultamericas 201408168190507~201408160406260000~Z~71512988DF16F834B22D4E4BDA47F0B1 -o D:\temp
ds 1A37922FFA291944494A84F24515820B91110000vaultamericas 201407115080514~201407101212130000~Z~801C56B92B9DB9BCDE62A2019F4EC7E1 -o D:\temp
How can I do this in a big batch? Obviously I don't want to copy/paste 1000s of times.
thanks
Solved! Go to Solution.
10-13-2014 11:49 AM
One of my scripting gurus came up with this powershell script, in case anyone is interested. Change F:\temp and data.csv as needed. Data.csv should look like:
1A37922FFA291944494A84F24515820B91110000vaultamericas,201312197433041~201312172129370000~Z~4005840D68DE14BB8B1F5A4F80E15AE1
1A37922FFA291944494A84F24515820B91110000vaultamericas,201312207525766~201312191625230000~Z~504D79DE7B77BE51572720F5A2D92D31
1B12861C18E81BC4DAF1E6A2602E0ECBF1110000vaultamericas,201312177281316~201312171045530000~Z~714ED6511C67D129E2DDFCAB229124F1
----------START OF SCRIPT-------------
$out = "F:\temp"
$ErrorActionPreference= 'silentlycontinue'
foreach($line in gc data.csv){
$tID = $line.split(",")[0] -replace "~", "{~}"
$sID = $line.split(",")[1] -replace "~", "{~}"
$id = (start-process "D:\Program Files (x86)\Enterprise Vault\evsvr.exe" -passthru).id
start-sleep -s 2
[void] [System.Reflection.Assembly]::LoadWithPartialName("'Microsoft.VisualBasic")
[Microsoft.VisualBasic.Interaction]::AppActivate("D:\Program Files (x86)\Enterprise Vault\evsvr.exe")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("Interactive")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("~")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("ds $tID $sID -o $out")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("~")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("exit")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("~")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("exit")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("~")
while(get-process -id $id){
start-sleep -s 2
}
stop-process -id $id
start-sleep -s 2
}
10-08-2014 03:18 PM
what are you trying to accomplish? are you working with support on a case?
10-09-2014 06:43 AM
Not working with support.
Basically I have 3 very large CA searches. I want to export the results without accepting the search (I don't need this search in CA and don't want to unnecessarily increase DB size).
I have all the SaveSets and Transaction IDs via SQL,
I can export the individual .msg files using EVSVR in interactive mode. But I want to do a bulk operation as per my original post.
thanks
10-09-2014 10:28 AM
sorry i'm not aware of a way to batch ds commands in evsvr. maybe one of the gurus has a creatve approach for you.
10-10-2014 10:49 AM
Appreciate your help. In the absence of "the gurus" I may not have a choice except accepting these large searches in CA and exporting through the client... :( thanks
10-13-2014 11:49 AM
One of my scripting gurus came up with this powershell script, in case anyone is interested. Change F:\temp and data.csv as needed. Data.csv should look like:
1A37922FFA291944494A84F24515820B91110000vaultamericas,201312197433041~201312172129370000~Z~4005840D68DE14BB8B1F5A4F80E15AE1
1A37922FFA291944494A84F24515820B91110000vaultamericas,201312207525766~201312191625230000~Z~504D79DE7B77BE51572720F5A2D92D31
1B12861C18E81BC4DAF1E6A2602E0ECBF1110000vaultamericas,201312177281316~201312171045530000~Z~714ED6511C67D129E2DDFCAB229124F1
----------START OF SCRIPT-------------
$out = "F:\temp"
$ErrorActionPreference= 'silentlycontinue'
foreach($line in gc data.csv){
$tID = $line.split(",")[0] -replace "~", "{~}"
$sID = $line.split(",")[1] -replace "~", "{~}"
$id = (start-process "D:\Program Files (x86)\Enterprise Vault\evsvr.exe" -passthru).id
start-sleep -s 2
[void] [System.Reflection.Assembly]::LoadWithPartialName("'Microsoft.VisualBasic")
[Microsoft.VisualBasic.Interaction]::AppActivate("D:\Program Files (x86)\Enterprise Vault\evsvr.exe")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("Interactive")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("~")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("ds $tID $sID -o $out")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("~")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("exit")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("~")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("exit")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("~")
while(get-process -id $id){
start-sleep -s 2
}
stop-process -id $id
start-sleep -s 2
}
10-13-2014 12:52 PM
niiiiice
11-13-2019 05:18 AM
Still works in EV12.3 :)
When copying, I got the smily shown as ":Frustrated Man"
Replace that with "::S" and your good to go.
09-20-2021 07:21 AM
Hi,
many, many Thanks!
I extended this to MSG files. We have some EV shortcuts in our DSM and I need to extract mails depending on msg files. For sure you can extend it to process more files.
$arrTemp=Get-Content '.\test.msg'
$out = ".\Export"
$removeDir=$out+"\EVSVR_DumpSaveset*"
$strSearch='/EnterpriseVault/Search/htmlview.aspx?'
foreach ($line in $arrTemp)
{
$n=0
$strTemp=""
for ($i=0; $i -le $line.length; $i++)
{
if ($line[$i] -ne " " -and $line[$i] -ne "`0")
{
$strTemp+=$line[$i]
if ($i -gt 30)
{
#break
}
}
}
if ($strTemp -like "*$strSearch*")
{
$strTemp=$strTemp -split $strSearch
$strTemp=$strTemp[1] -split "View"
$strTemp=$strTemp -split "VaultId="
$strTemp=$strTemp[1] -Split "&SavesetId="
$tID=$strTemp[0] -replace "~", "{~}"
$sID=$strTemp[1] -replace "~", "{~}"
break
}
}
Write-Host "$tID;$sID"
$ErrorActionPreference= 'silentlycontinue'
$id = (start-process "C:\Program Files (x86)\Enterprise Vault\evsvr.exe" -passthru).id
start-sleep -s 2
[void] [System.Reflection.Assembly]::LoadWithPartialName("'Microsoft.VisualBasic")
[Microsoft.VisualBasic.Interaction]::AppActivate("D:\Program Files (x86)\Enterprise Vault\evsvr.exe")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("Interactive")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("~")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("ds $tID $sID -o $out")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("~")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("exit")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("~")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("exit")
[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("~")
while(get-process -id $id)
{
start-sleep -s 2
}
get-childitem $out -recurse -Filter "*.msg" |Move-Item -Destination $out
Remove-Item $removeDir -Confirm:$False -Recurse