VBA: Extracting mail attachements from archived mails
Like many others, i had a problem extracting attachement from archived mail items. The name of the attachement is "@" instead of the actual file name. It was suggested in a particular mail to use the API, but you need EVAdmin to do so. (CreateObject("EnterpriseVault.ContentManagementAPI") failed) Another suggestion was to read the HTMLbody of the mail and search for the filename. After a little research, i found that, if you "Display" the mailitem, it will be accessible as any other mailitem, including the attachements. Here's the code: Private Function GetSelectedMailAttach() As String Dim olApp As Outlook.Application Dim olExp As Outlook.Explorer Dim olSel As Outlook.Selection Dim olItem As Outlook.MailItem Dim olAtt As Outlook.Attachment Dim olInsp As Outlook.Inspector Dim olSelItem As Outlook.MailItem Dim olOpnItem As Outlook.MailItem Dim i As Long Dim strRet As String On Error GoTo ErrorHandler Set olApp = GetObject("", "Outlook.Application") Set olExp = olApp.ActiveExplorer Set olSel = olExp.Selection If olSel.Count = 0 Then MsgBox "No mailitems selected!", vbExclamation GoTo Finalize End If For i = 1 To olSel.Count Set olInsp = Nothing Set olSelItem = olSel.item(i) olSelItem.Display Do While olInsp Is Nothing Set olInsp = olApp.ActiveInspector Loop Set olOpnItem = olInsp.CurrentItem For Each olAtt In olOpnItem.Attachments If olAtt.Type <> olOLE Then olAtt.SaveAsFile Environ("TEMP") & "\" & olAtt.DisplayName If strRet = "" Then strRet = Environ("TEMP") & "\" & olAtt.FileName Else strRet = strRet & vbCrLf & Environ("TEMP") & "\" & olAtt.FileName End If End If Next olOpnItem.Close olDiscard Next If strRet = "" Then MsgBox "No attachements found in selected mails!", vbExclamation End If GetSelectedMailAttach = strRet GoTo Finalize ErrorHandler: MsgBox Err.Description, vbCritical Finalize: Set olAtt = Nothing Set olItem = Nothing Set olSel = Nothing Set olExp = Nothing Set olApp = Nothing Set olInsp = Nothing Set olSelItem = Nothing Set olOpnItem = Nothing End FunctionSolved3.7KViews4likes5CommentsAfter PST Migration Completed End User Can't Open Outlook
Enterprise Vault 11.0.1 CHF1,On Windows 2008 R2,Exhange 2013 CU8,End user uses outlook 2013. AfterPST migration completed when end user trys to open his outlook he faces with error which PST Outlook data filecan not be found. By manuellyI can remove PST file which is migrated and solve this issue. But this is "Server driven pst migration" method and more than thousandend users. Arethere any settings, policy or parameters on Enterprise Vault side to solve this issue automatically.Solved668Views2likes2CommentsProvisioning API Failing
Hi, I have been using a vbscript for a number of years that uses the evpm to prevent archiving the "DoNotArchive" folder in a users mailbox. I think that this stopped working around the time we moved to Windows 2008 R2 and EV10SP4 but I can't be sure. When the script runs now I get the error: An error occurred replacing the script parameters I have now used the example in the EV utilities guide (About using the Provisioning API to run Policy Manager Scripts, p253) as per below: option explicit Dim ArrayOfParameters(0) ArrayOfParameters(0) = "true" Dim Enabler Set Enabler = CreateObject("EnterpriseVault.ExchangeArchivePoint") Enabler.Directory = "MACHINE1" Enabler.Site = "site1" '(Entry Id or Site Name) Enabler.ExchangeServer = "DITTO" '(Entry Id or Exchange Name) Enabler.SystemMailbox = "EnterpriseVault-DITTO" Enabler.MailboxDN = "/o=Eng2000/ou=First Administrative Group/cn=Recipients/cn=Bruiser" Enabler.SetScriptFile "C:\MyScripts\Script1.ini", ArrayOfParameters Enabler.ExecuteScript ' runs the EVPM script against the script1.ini file after making the substitutions in the strings. and I get the same error. I did amend the values relevant to my site but that was it. I raised a call with Symantec and they said I had missed the brackets on the line: Enabler.SetScriptFile "C:\Program Files (x86)\Enterprise Vault\Scripts\EVPM\EnableScript_DONOTARCHIVETest2.ini", ArrayOfParameters So I added them in: Enabler.SetScriptFile ("C:\Program Files (x86)\Enterprise Vault\Scripts\EVPM\EnableScript_DONOTARCHIVETest2.ini", ArrayOfParameters) But then got the error: Cannot use parentheses when calling a Sub Symantec support said that they get the same errors (with their own script out of the the utilities guide) but cannot help me any further as they don't support scripts. Does anyone else use vbscript for EVPM on Windows 2008 R2 EV10SP4 and if so have you had the same issues and overcome them. Symantec support couldn't offer an alternative for me other than I would have to manually use evpm for each of our mailboxes. We have thousands. Any help would be greatly appreciated. MattSolved724Views2likes3CommentsTrying to connect to Discovery Accelerator API
Hello Everyone, I'm trying to connect to the Discovery Accelerator API but keep getting the following error when I call the GetConfigurationData() method. Here is the code i'm using to connect. DiscoverySoapClient c = new DiscoverySoapClient(); c.ClientCredentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials; c.Open(); try { var con = c.GetConfigurationData(); int offset = 0; int count = con.MaximumItemChunkSizeBytes; string temp = Path.GetTempFileName(); using (FileStream fs = File.OpenWrite(temp)) { while (true) { byte[] data = c.GetItem(28390389021, offset, count, out contentInfo); fs.Write(data, 0, data.Length); offset += data.Length; if (data.Length < count) break; } } FileInfo fi = new FileInfo(temp); fi.MoveTo(fn); Assert.IsTrue(File.Exists(fn)); } catch { c.Close(); } Here is my web.config file; <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="DiscoverySoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="false"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647" /> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address=http://NAME.OF.THE.SERVER/generalsearch/discovery.asmx binding="basicHttpBinding" bindingConfiguration="DiscoverySoap" contract="SymantecWS.DiscoverySoap" name="DiscoverySoap" /> </client> </system.serviceModel> </configuration> The error I'm getting is the following;697Views2likes1CommentRestore archived mail / api
Hi there, I have a similar problem as mentioned in this thread:https://www-secure.symantec.com/connect/forums/fetch-mail-andor-mail-entryid-ev-sdk I want to unarchive an email from outside the enterprise vault http-only addin - in my custom outlook addin. I know there is no support for what I am doing, but for the convenience of the users I would risk it. As far as I understand it should be two steps to replace the archived mail with the original: Set the mail MessageClass to “IPM.Note.EnterpriseVault.Shortcut.RestoreMe”; Do a http call to the enterprise vault webservice (got it from fiddler). I can easilydo step 1 - in step 2. I get an http 200 so I assume I did everything correctly. But now the mail is not replaced - is there something I am missing? Thanks a lot! MaxSolved1.9KViews1like9CommentsFSAUtility not restoring all files
Hi All Please i need your assistance on this one, one of our clients need to do a full restore of two folders, when running the FSAUtility with the following (FSAUtility.exe - t -s UNC path -d UNC path -f -l 0) its restores +/- 4500 items out of +/-38000 there are no errors reported in the logs etc. we are able to open these archived items We have now come to a dead end please help thank you664Views1like2CommentsIn VBA/Outlook, how to list attachments to EV-archived item
I'm trying to write a utility in VBA/Outlook which will list DIR-style the names of files attached to messages. But we have Enterprise Vault, andI don't know what to do with messages in the vault. I can detect vaulted messages by checking whether MessageClass= "IPM.Note.EnterpriseVault.Shortcut", and I find they all have one attachment named "@". If a message isn't vaulted, I can enumerate any attachments and spit out their names along with the message's folder path, subject line and received date to help the user find the message. How can I open a vaulted message, preferably without restoring it, just to get a list of its attachments? Please don't forget to point me to the library I should add to Tools / References -- all I can find on Google is CreateObject("EnterpriseVault.ContentManagementAPI"), but it fails. Here's my code so far: Option Explicit Sub SearchForAttachments() Dim WildCard$, FH%, Fld As Folder, MI As MailItem, NA&, NF&, NI& On Error GoTo 0 'ABEND Set Fld = Outlook.ActiveExplorer.CurrentFolder WildCard$ = InputBox$("Gimme a filename wildcard like '*.*'") If Len(WildCard$) Then Close FH% = FreeFile() 'Open Environ$("TEMP") & "\Attachments.txt" For Random As #FH% Call DirAttachments(Fld, WildCard$, FH%, NA&, NF&, NI&) Debug.Print NA& & " attachments in " & NI& & " items (with attachments) in " & NF& & " folders under " & Fld.Name 'Close End If ABEND: If Err.Number Then MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical, , Err.HelpContext, Err.HelpContext Close End Sub Sub DirAttachments(Fld As Folder, WildCard$, FH%, NA&, NF&, NI&, Optional Prefix$ = "") Dim I As Object, MI As MailItem, F As Folder Prefix$ = Prefix$ & "\" & Fld.Name NF& = NF& + 1 For Each I In Fld.Items: DoEvents ': Debug.Print "."; Select Case TypeName$(I) Case "MailItem" If I.Attachments.Count > 0 Then 'And I.MessageClass <> "IPM.Note.EnterpriseVault.Shortcut" Call ListAttachments(I, WildCard$, FH%, NA&, NF&, NI&, Prefix$) End If End Select Next For Each F In Fld.Folders Call DirAttachments(F, WildCard$, FH, NA&, NF&, NI&, Prefix$ & "\" & Fld.Name) Next End Sub Sub ListAttachments(I As Object, WildCard$, FH%, NA&, NF&, NI&, Prefix$) Dim A As Attachment, MI As MailItem ', First As Boolean 'First = True NI& = NI& + 1 For Each A In I.Attachments: DoEvents If A.Type = olByValue Then 'And A.FileName Like WildCard$ 'If First Then Debug.Print: Debug.Print Prefix$ & "\" & I.Subject & " (" & I.ReceivedTime & ")": First = False Debug.Print Prefix$ & vbTab & I.Subject & vbTab & I.ReceivedTime & vbTab & A.FileName NA& = NA& + 1 End If Next End SubSolved1.4KViews1like2Comments