jobRunner.vbs: Function RunExmerge

Function RunExmerge(ByVal serverName)
  Dim listFile, objFile, strComputer, objWMIService, objExec, itemsInQueue
  Set WshShell = WScript.CreateObject(“WScript.Shell”)
  Set objFS = CreateObject(“Scripting.FileSystemObject”)

  listFile = ExmergeFolder & serverName & “DNs.txt”
  Set objFile = objFS.OpenTextFile(listFile,ForReading)
  itemsInQueue = objFile.AtEndOfStream
  objFile.Close

  If itemsInQueue <> True Then
    WriteLog “Running Exmerge for server ” & serverName
    strComputer = “.”
    Set objWMIService = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & strComputer & WSH_Namespace)
    Set objExec = WshShell.Exec(“E:\program files\Exchsrvr\bin\Exmerge.exe -B -F ” & ExmergeFolder & serverName &”.ini -logmed”)
  End If
End Function