AD MA - Error Log RRS feed

  • Question

  • Hi,

    How can I write to eventlog any errors that occur during AD MA run?

    Many thanks,


    Tuesday, April 7, 2015 9:10 AM

All replies

  • Hi,

    I do something similar to this with two steps.

    In the PowerShell I use to run the sync, I save the results to an XML file:

    $runDetails = $curMA[0].RunDetails().ReturnValue

    $doc = New-Object System.Xml.XmlDocument


    $doc.Save("F:\Logs\" + $MAName + " " + $dNow + ".xml")

    Then, I have a small exe I wrote that runs after the sync finishes and parses any errors to a SQL table.

    You could write something similar to write to the event log. It could be a PowerShell script (Write-EventLog cmdlet) and not an exe--I'm just faster with C#, so that was a better option at the time.



    Tuesday, April 7, 2015 12:45 PM