AD MA - Error Log

Hi,

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

Many thanks,

DD

April 7th, 2015 5:11am

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.LoadXml($runDetails)

$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.

HTH,

Sami

Free Windows Admin Tool Kit Click here and download it now
April 7th, 2015 8:46am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics