PowerShell Enterprise Vault FSAUtility report validator

So I needed to do a recall of approximately 1.650 user directories in a hidden share to another location.
Basically what we did is sharing an empty folder as the Enterprise Vault target volume on the fileserver. On the Enterprise Vault server we executed the following command per user:
fsautility -c -s "\\FileServer.domain.local\users$\username1...username1650" -l 0

This means:

  • -c: recreate placeholders
  • -s: source path of the archived data
  • -l: 0 = log everything and 1 = log only failed items


I created 16 batch files with circa 100 commands in it. Each command within the batch file is sequentially executed. But I was able to execute 6 to 7 batches at the same time. This results in a serious optimization of the required time frame. However this leads to one serious problem when trying to verify your operations. You need to walk through 1.650 logfiles (one per command) to see if everything is restored as it should.

As I’m a bit lazy and certainly don’t want to verify 1.650 logfiles, I wrote myself a little powershell script to assist me in this matter:

$files = Get-ChildItem "C:\Users\rrdhyv8\Desktop\work directory\FSAUtilityReports"
[xml]$fsareport = ""
$LogFile = "C:\FSAUtilityReportValidationscript.csv"

"Report|Path|Success|File Exists|Something Else" | Out-File $LogFile -Append

foreach ($file in $files) {
    Write-Host $file.fullname
    [xml]$fsareport = Get-Content $file.FullName
    
    $success = 0
    $fileexists = 0
    $somethingelse = 0
    $path = $fsareport.FSAUtilityLog.Header.SourcePath
    
    foreach ($item in $fsareport.fsautilitylog.itemlist.item) {
        $errorcode = $item.ErrorCode
        
        if ($errorcode.CompareTo("Success") = 0) {
            $success++
        } elseif ($errorcode.CompareTo("File exists") = 0) {
            $fileexists++
        } else {
            $somethingelse++
        }    
    }
    
    Write-Host "Success: " $success
    Write-Host "File exists: " $fileexists
    Write-Host "Something else: " $somethingelse
    
    $file.FullName + "|" + $path + "|" + $success + "|" + $fileexists + "|" + $somethingelse | Out-File $LogFile -Append
}

This gives me an Excel file with the following information:

  • Report name
  • The source path of the recall operation
  • Items succesfully restored
  • Items encountered that already existed
  • All other values like failures, errors, etc

It dumps all the information to a CSV file with the pipe (|) as a delimiter. This gives you the possibility to convert the text to column-separated data, which also brings you the possibility to implement data filters and sorting.

Leave a Reply