10-22-2010 07:46 PM
Good evening all! I'm hoping someone with better vbscript skills than myself, or someone who has already done this can help me out.
I'm looking to ingest upwards of 30K to 40K PST files into a shared archive. So, I know the EVPM scripting and .ini files will work for this, but the problem is you can't specify a [PST] File descripter with a wildcard. So, I've got directory with say 1K of PST's. I need to generate an EVPM script INI utilizing all these file names. Anyone have a ready made solution, or could help me with the scripting?
Thanks much in advance,
Mike S
Solved! Go to Solution.
10-25-2010 06:16 PM
i'll check in to it for you, i do believe though with this script there would be an issue regarding unicode, since all EVPM scripts need to be pushed out to unicode and not ANSI
my first guess though is that its these two lines
- Set TemplateEVPM = fso.GetFile("c:\test\TemplateEVPM.ini")
- EVPMFileName = "C:\Test\EVPM\" & folderIdx.Name & ".ini"
Either it can't read the TemplateEVPM.ini (is it the correct location) or the EVPMFileName part for where the EVPMs go is wrong. just needs more bullet proofing and correction, will look at it in a bit
10-23-2010 12:47 PM
This isn't an ideal solution, but here's what i just knocked up quickly, may work as a good starting point
C:\Test\TemplateEVPM.ini
[Directory] DirectoryComputerName = evserver1 sitename = EVSite [PSTDefaults] MigrationMode=process PSTLanguage=Western European ConcurrentMigrations=1 IncludeDeletedItems=True ShortcutMode=NoShortcuts [PST] FileName=<&&FILENAME&&> ArchiveName=myArchive RetentionCategory=General ServerComputerName=evserver1.myDomain.com
C:\Test\GenerateEVPMs.vbs
On Error Resume Next ' Dim the file system objects Dim EVPMObj, ReadEVPM, WriteEVPM, PSTFile, fso Dim EVPMFileName, PSTFileName, EVPMContents, folder, files, sFolder Set fso = CreateObject("Scripting.FileSystemObject") Set folder = fso.GetFolder("C:\Test\PSTs") Set files = folder.Files For each folderIdx In files WScript.Echo "Found The following PST File " & folderIdx.Name Set TemplateEVPM = fso.GetFile("c:\test\TemplateEVPM.ini") EVPMFileName = "C:\Test\EVPM\" & folderIdx.Name & ".ini" PSTFileName = "C:\Test\PSTs\" & folderIdx.Name TemplateEVPM.Copy(EVPMFileName) Set EVPMObj = CreateObject("Scripting.FileSystemObject") Set ReadEVPM = EVPMObj.OpenTextFile(EVPMFileName, 1) EVPMContents = ReadEVPM.ReadAll ReadEVPM.Close PSTFile = Replace(EVPMContents, "<&&FILENAME&&>", PSTFileName) Set WriteEVPM = EVPMObj.OpenTextFile(EVPMFileName, 2) WriteEVPM.WriteLine PSTFile WriteEVPM.Close EVPMCommand = """C:\Program Files\Enterprise Vault\EVPM.exe"" -e exchServer.myDomain.com -m EVSysMailbox -f " & EVPMFileName WScript.Echo "Starting Import of " & PSTFileName Set wshShell = WScript.CreateObject ("WSCript.shell") wshshell.run EVPMCommand, 6, True set wshshell = nothing Next
To Run the file open a command prompt and type "cscript generateEVPMs.vbs" The output should look like this
C:\Test>cscript GenerateEVPMs.vbs Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. Found The following PST File application.pst Found The following PST File eventgateway.pst Found The following PST File exception.pst Found The following PST File server.pst
10-25-2010 06:24 AM
Thanks much. I'll give this a run today and let you know how it works. Very much appreciated!
10-25-2010 06:37 AM
If i were you for the testing, copy out 100 PST files (make a copy, don't move them)
The reason i say copy and test is because EV Will delete the contents of items its ingested, so if you were to do it to a test archive straight off and you werent happy with the results, well now you've lost the contents of the PST file to start again.
You may also want to put something in the code that renames each INI file after its completed or to delete it, oh and pay attention to On Error Resume Next that means that if it encounters any errors it will just soldier on and you may think nothings wrong but it's silently throwing errors that it won't display
10-25-2010 11:19 AM
Neat script there JW2. I'll sure something like this would be useful for many people?
10-25-2010 04:46 PM
When I try to run this, the .ini files don't populate with anything. So I commented out "on error resume next" to see what was happening. I get an error on line 27 Invalid Procedure Call or Argument 800A0005. Googling this in relation "WriteLine" I found some references this being caused by trying to copy text from a unicode file. I tried saving the vbs file as unicode, but that didn't seem to help. Any idea what I need to do with that?
10-25-2010 06:16 PM
i'll check in to it for you, i do believe though with this script there would be an issue regarding unicode, since all EVPM scripts need to be pushed out to unicode and not ANSI
my first guess though is that its these two lines
- Set TemplateEVPM = fso.GetFile("c:\test\TemplateEVPM.ini")
- EVPMFileName = "C:\Test\EVPM\" & folderIdx.Name & ".ini"
Either it can't read the TemplateEVPM.ini (is it the correct location) or the EVPMFileName part for where the EVPMs go is wrong. just needs more bullet proofing and correction, will look at it in a bit