Skip to content

Flat File Connector Troubleshooting

Andreas Kjellman edited this page Feb 6, 2019 · 17 revisions

The Windows PowerShell connector supports logging and tracing of connector and script activities for troubleshooting purposes.

Errors from the sync engine

Critical errors will be logged to the Application log on the Synchronization Service server and additional tracing can be enabled by the administrator.

Event Log

When a fatal error occurs while the PowerShell connector is running, or during the configuration of the connector in the Management Agent Designer, the Synchronization Service will log an event with the following details:

Parameter Value
Log Application
Level Error
Source FIMSynchronizationService
Event ID 6801
Task Category Server

Connector PowerShell Script Logs

If the event log is not providing enough information, then the next step is to get more information from the PowerShell script itself.

To see what the PowerShell script code is doing, find the following snip in the script relevant to the operation you are running (for example import or export).

# Uncomment this line to enable debug logging
# Out-File -InputObject $Message -FilePath $Path -Append

Remove the hash (#) sign from the second line to enable tracing. The files are written to %WinDir%\temp, which is the location the sync engine grants its service account write permissions to for this purpose.

Enabling these logs is the easiest to find easy problems with the PowerShell script code and how it works in your environment. If this does not help, you can enable detailed tracing in the connector itself.

Connector Logging/Tracing

The Windows PowerShell connector can be configured to emit tracing information to any .NET TraceListener (e.g. event log, XML file, text file, etc.).

Administrators can also configure the connector to log information produced by the Write-Warning, Write-Verbose, and Write-Debug cmdlets to the trace log.

Enabling Tracing

  1. Open the %ProgramFiles%\Microsoft Forefront Identity Manager\2010\Synchronization Service\bin\miiserver.exe.config file using a text editor.
  2. Paste the following XML in to the file on the line immediately following the sources tag.
<source name="ConnectorsLog" switchValue="Verbose">
      <listeners>
            <add initializeData="C:\Windows\Temp\ConnectorsTrace.log"
                  type="System.Diagnostics.TextWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                  name="ConnectorsTraceListener">
                  <filter type="" />
            </add>
      </listeners>
</source>

The <System.Diagnostics> section of the miiserver.exe.config file should now resemble the following excerpt:

Verbose Logging enabled

  1. Restart the Synchronization Service.

As described in the previous section, the service account has write permissions to %WinDir%\Temp and this is the recommended location for trace files to be written.

PowerShell Script Tracing

To trace information from Windows PowerShell scripts, you must complete the following step:

  1. Add logging to your scripts in the form of Write-Verbose, or Write-Debug statements.