One of the puzzles I have seen in the MIM ECMA is what do I do when an error is encountered when processing records? If you throw an exception then the whole batch queue is ruined (quite a common occurrence in the MIM MA). But then I would like to capture the exception error so that I see details of what the issue is.
Solution
Create an event log for your ECMA e.g “SAP” say its for an SAP connector. You can do that via PowerShell or C# code. Then in you ECAM code create a function to call the log.
-
public void MyEventLog(string myLogname, string myMessage, string mySource)
-
{
-
EventLog eLog = new EventLog(myLogname);
-
EventLogEntryType myType = EventLogEntryType.Error;
-
myLog.Source = mySource;
-
eLog.WriteEntry(myMessage, myType);
-
}
Write to the event log in your ECMA rather than throwing an exception. Here is a sample
-
catch (Exception ex)
-
{
-
MyEventLog(“SAP”, “EmployeeId: “ + emplID + ” Error Email update of user: “ + ex.Message, “Export AD Info”);
-
}