A simple function to check if any exports are ending before runing an Export. You can save time and transaction log space if you avoid running jobs which aren’t actually needed.
Â
Dim MIIS_Service
Set MIIS_Service = GetObject(“winmgmts:root\MicrosoftIdentityIntegrationServer”)‘—————————————————–
‘Â Function ExportsPending
‘Â + Returns TRUE if objects are waiting to be exported
‘—————————————————–Function ExportsPending(MA)
 Dim ManagementAgent Set ManagementAgent = MIIS_Service.Get(“MIIS_ManagementAgent.Name='”& MA &”‘”)
 If (ManagementAgent.numExportAdd() + ManagementAgent.numExportUpdate() + ManagementAgent.numExportDelete()) > 0 Then
   ExportsPending = TRUE
 Else
   ExportsPending = FALSE
 End If
End Function