I have been doing some work on PST Migrations over the last few days to discover what happens under circumstances. The work has been interesting, and varied. There is at least one bug that I have escalated, but this post is really just to track an interesting little bit of SQL that I did.
My repro involved locating 11,000 PST files that I created. I had to do this several times.
The first hurdle then is that I didn’t really fancy creating 11,000 PST files manually, and copying and pasting them in Windows Explorer is also a bit of a pain. I wrote a little VBScript which will copy a single PST many, many times .. here it is :
maxloop = 10000
dim filesys, demofile
set filesys = CreateObject (“Scripting.FileSystemObject”)
set demofile = filesys.GetFile(“c:temppstsfile1.pst”)
do while loopcounter < maxloop
demofile.Copy(“c:temppstsfile1-A” & loopcounter & “.pst”)
loopcounter = loopcounter + 1
The problem with running PST migration multiple times (or rather the PST Locator) is that by default it only scans remote machines hard-drives once every 24 hours. The easiest way, I found, to get around this is to reset the date of the last scan, so after each locator-task run, I executed the following SQL :
Delete from pstfile;
Update pstlocatortask set hardsearchlasttime = ‘2008-09-01 03:00:00.000’