This article outlines the step by step procedure to set a Scheduled Task to start and Stop CDF Tracing based on a Trigger (Time, Event ID etc). The example shown in this article is based on Time trigger.
Make sure you have the latest copy of CDFcontrol downloaded before attempting the procedure below. You can download CDFControl from:
http://support.citrix.com/article/CTX111961
1. Create a text file with the names of the machines (one machine per line) as below:
Here it is named as VDAList.txt
2. Create a custom .CTL file if required with a subset of required trace providers. If you are planning to take All module trace, just get the CTL file for VDA/DDC/Client. Eg:
Here it is named as DesktopVDATraceProviders.ctl
Note: To create custom ctl file, launch CDFControl locally on the VDA/DDC/Client machine, select the necessary modules (Or all modules) as per the requirement, go to Tools > Create CTL file and save it with an appropriate name.
3. Open Task Scheduler and create a new task (Control Panel > Administrative Tools > Task Scheduler > Create Task)Arguments needed:
-start -guids <FullPathof .ctl file> -machinelist <fullpathofTextfile>
Eg:
-start -guids c:\tools\CDFControl\DesktopVDATraceProviders.ctl -machinelist c:\tools\CDFControl\VDAList.txt
Click Ok.
Note: -machinelist is an optional parameter. Only if you are tracing multiple remote machines you will need this parameter. If you are tracing only local computer then you can drop this parameter. Additional parameters such as -mode and -MaxLog can also be added to manage the type of logging and the log file size.
-mode <Circular - 2, Sequential -1, MulSeq - 8>
-maxlog <Maximum log file size in MB>
Similarly you will have to create another task to stop CDF control with a different Trigger time to stop the trace. The arguments needed for CDFControl would be:
-stop -machinelist <FullPathofTextFile>
Eg: -stop -machinelist C:\Tools\CDFControl\VDAlist.txt
When the CDF trace is started, you may not see the log files immediately. This is normal. When the task to stop CDFcontrol runs, you will see a new folder named CDFControl_Remote_Traces in the same folder as CDFControl.exe and it will contain the traces from the target machines.
For more information on Task Scheduler, please refer to:
https://technet.microsoft.com/en-us/library/cc749579(v=ws.11).aspx