jobRunner.vbs: Function RunProfile

Function RunProfile(MA, Profile)
  Dim ManagementAgent,  Status

  If MA = “” then Exit Function
  WriteLog “Running ” & MA & ” ” & Profile
  Set ManagementAgent = MIIS_Service.Get(“MIIS_ManagementAgent.Name='”& MA &”‘”)

  Status = ManagementAgent.Execute(Profile)
  WriteLog MA & “, ” & Profile & ” ” & ManagementAgent.RunStatus
  If Status = “success” then  
    RunProfile = 0
  ElseIf Status = “completed-sync-errors” then
    RunProfile = -1
  Else
    RunProfile = -1
  End if
End Function