Posted On August 18, 2022

Disable and Enable Trace Logging for Dynamics CRM

kimconnect 0 comments
blog.KimConnect.com >> Codes >> Disable and Enable Trace Logging for Dynamics CRM
# Set common variables
$serverTracingRegistry='Registry::HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\MSCRM'

# Enable CRM Tracing
Add-PSSnapin Microsoft.Crm.PowerShell
$setting = Get-CrmSetting TraceSettings
$setting.Enabled = $True
$setting.Directory = "D:\crmTraceLogs"
Set-CrmSetting $setting
$traceRefreshCurrentValue=(Get-ItemProperty -path $serverTracingRegistry).'TraceRefresh'
Set-Itemproperty -path $serverTracingRegistry -Name 'TraceRefresh' -value 1
Set-Itemproperty -path $serverTracingRegistry -Name 'TraceEnabled' -value 1

# Disable Tracing
Add-PSSnapin Microsoft.Crm.PowerShell
$setting = Get-CrmSetting TraceSettings
$setting.Enabled = $False
Set-CrmSetting $setting
Set-Itemproperty -path $serverTracingRegistry -Name 'TraceRefresh' -value 0
Set-Itemproperty -path $serverTracingRegistry -Name 'TraceEnabled' -value 0
write-host "Must run IISRESET for changes to be effective"

 
# Check current settings
(Get-CrmSetting TraceSettings).Enabled
Get-ItemProperty -path $serverTracingRegistry -Name 'TraceRefresh'
Get-ItemProperty -path $serverTracingRegistry -Name 'TraceEnabled'

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Linux: Use Lubuntu 20.04, TightVNC Server, NoVNC, WebSockify to Create a Terminal Server Accessible via Any Browser!

Use Case:Imagine a virtual classroom with students using Chromebooks, iPads, and other types of computers,…

Deploying LDAP / Active Directory Self Service Password Portal

Overview: There are several choices of platforms to deploy Password Manager: Kubernetes, Docker, Windows, and…

Some Useful Windows Commands to Troubleshoot Networking on Windoze

# Check this computer's trust relationship to its domain controllers$domainName="intranet.kimconnect.com"PS C:\Windows\system32> nltest /SC_QUERY:$domainNameFlags: 0Trusted DC…