Hi,
How can I write to eventlog any errors that occur during AD MA run?
Many thanks,
DD
Technology Tips and News
Hi,
How can I write to eventlog any errors that occur during AD MA run?
Many thanks,
DD
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