How to fix ‘Invalid Trace Directory’ errors

As part of the migration process I’ve been going through the event logs for our CRM deployment to ensure everything is working correctly, during this I came across an ‘Invalid Trace Directory’ error (event id 17203) which was showing the following –

Invalid Trace Directory. Additional Info:[ Invalid Trace Directory (Reporting Process:Trace Diretory is Null. TraceSettings: {Filename:  ,FileCountSuffix:1 ,TraceFileSize:10485760 ,TraceDirectory: ,TracingCallStack:No ,IsTracingOff:Yes ,LoadState:LoadSuccessfulUnreported ,RefreshTraceInt:-1 ,SiteWideRefreshTraceInt:-1 ,RegistryRefreshTraceInt:6 ,Precedence:Default} ] , AppDomain:CrmAsyncService)

This error is because by default the Trace Directory will be set to ‘C:\crmdrop\logs’ which doesn’t normally exist (but you can just create it for a quick fix, I’d suggest changing it using the instructions below though).

Although this error doesn’t cause a huge issue it can keep producing quite a few errors in the event log which nobody likes to see –


Now this is pretty easy to resolve using a bit of PowerShell as I’ll show below.

Ensure You Can Run PowerShell Commands

You may have to set the PowerShell execution policy to unrestricted temporarily if the servers not setup to allow PowerShell commands.

  1. Open PowerShell.
  2. Type ‘set-executionpolicy unrestricted’
  3. Confirm by pressing Y.
  4. Done you can now run the required PowerShell commands.

Fix The Problem

  1. Open PowerShell again if required.
  2. Either type the following code or copy from the end of the article –

    Add-PSSnapin Microsoft.Crm.PowerShell
    Get-CrmSetting TraceSettings
    $setting=Get-CrmSetting TraceSettings
    $setting.Directory="C:\Program Files\Microsoft Dynamics CRM\Trace"
    Set-CrmSetting $setting
    Get-CrmSetting TraceSettings


  3. Run the code which should fix the problem.
  4. Run ‘Set-executionpolicy restricted’ if you changed the execution policy before to revert it back.

Once this is done you’ll hopefully notice there will be no new errors in the event viewer for this issue

One thought on “How to fix ‘Invalid Trace Directory’ errors

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s