Using PowerShell to Address an “Invalid Trace Directory” Error in Microsoft Dynamics CRM 2011

At one of our clients, we kept seeing a pesky error in Microsoft Dynamics CRM 2011’s Event Log that the Trace Directory was not defined:

Invalid Trace Directory. Additional Info:[ Unable to Write file , Trace directory not defined (Reporting Process:File Name is Null. LocalTraceSettings: {Filename:  ,FileCountSuffix:1 ,TraceFileSize:10485760 ,TraceDirectory: ,TracingCallStack:Yes ,IsTracingOff:No ,LoadState:LoadSuccessfulUnreported ,RefreshTraceInt:-1 ,SiteWideRefreshTraceInt:-1 ,RegistryRefreshTraceInt:6} ] , AppDomain:CrmAsyncService)

We removed all registry keys related to Tracing, but the error kept appearing in the Event Log. With a little research, I was able to determine that the error was likely due to an invalid TraceDirectory setting of “c:crmdroplogs” in the DeploymentProperties table in the MSCRM_Config database. The best way to update this setting is in CRM 2011, is to use PowerShell.  Here is the specific list of commands we had to run to set the TraceDirectory to a valid value:


Add-PSSnapin Microsoft.Crm.PowerShell

Get-CrmSetting TraceSettings

$setting=Get-CrmSetting TraceSettings

$setting.Directory=”D:Program FilesMicrosoft Dynamics CRMTrace”

Set-CrmSetting $setting

Get-CrmSetting TraceSettings

It is worth noting that we were getting the aforementioned error even the Enabled setting was set to False. However, once we set the TraceDirectory setting to a valid value, the errors stopped appearing in the Event Log.

If you are a Microsoft Dynamics CRM Administrator, I strong recommend reviewing the full set of PowerShell cmdlets for CRM 2011 as documented on MSDN here. While most of these settings can be controlled using Deployment Manager, others are exposed only via PowerShell.

By | 2017-10-17T19:11:23+00:00 January 13th, 2012|Sales & Service (CRM), Tech Tips|4 Comments
Alternative Text

Contributor: AKA Enterprise Solutions

AKA is comprised of professionals with deep experience in business, technology, and their respective industries. Our team members regularly share their knowledge and expertise through blog articles. We hope you find them helpful, and we welcome your comments.

4 Comments

  1. hiit April 14, 2012 at 12:40 am - Reply

    Do you have a Facebook fan page for your site?

    • JKolakowski April 16, 2012 at 9:01 am - Reply

      Unfortunately at this time, we don’t have a corporate Facebook page, however, you can contact us via email or by phone to learn more about our products and services.

  2. click May 30, 2012 at 11:23 pm - Reply

    I have got one recommendation for your blog site. It appears like there are a handful of cascading stylesheet troubles while launching a selection of webpages inside google chrome and safari. It is running alright in internet explorer. Perhaps you can double check that.

    • JKolakowski May 31, 2012 at 8:24 am - Reply

      Thanks for the comments — I was able to successfully open both this post and the blog in Chrome and Safari, as well as IE. Perhaps you can provide me with information re: the versions you’re using etc., and I’ll look into it.
      Many thanks for taking the time to review the site and comment.

Leave A Comment