How to enable Store PFD tracing upon Reboot
Tracing Store startup problems upon server reboot is not an easy task as ExTRA tracing does not survive the server being rebooted whereas in Exchange 2003, the “Enable Tracing” key did survive a reboot.
After enabling an ExTRA session for PFD store startup tracing and looking at the contents of what was enabled when doing this, you will see the following from a command prompt.
Notice the “Microsoft Exchange Server 2007” provider with its GUID of 79bb49e6-2a2c-46e4-9167-fa122525d540. This is the provider that Exchange 2007 uses for most of its tracing
So now we need a way to trace this out. First, we need to create a method to enable logging and another way to enable the logging upon reboot of the server
Enable Tracing
Method 1
Logman (Built in to the OS)
---------------
1. Create a directory called Tracing (ex. C:\tracing)
2. Create the trace log using the “Microsoft Exchange Server 2007” provider that Exchange 2007 tracing uses. The GUID or the name of the provider can be used as shown below.
logman create trace ExchangeDebugTraces -p {79bb49e6-2a2c-46e4-9167-fa122525d540} -nb 3 25 -bs 3 -o c:\Tracing\
logman create trace ExchangeDebugTraces -p "Microsoft Exchange Server 2007" -nb 3 25 -bs 3 -o c:\Tracing\
After performing this, you can see this using a logman query command.
3. Create an EnabledTraces.Config file and add the following information to it and then save this file to the root of your C: drive. C:\EnabledTraces.Config
TraceLevels:Pfd
Store:tagPFDServerStart
FilteredTracing:No
InMemoryTracing:No
Note: You could also create this same file by using the ExTRA interface to enable this tracing as well, thus populating the same information as listed above.
4. Create a start_tracing.cmd file and add the following information to the file. Save this to the location created in Step 1.
Logman start ExchangeDebugTraces
Running logman query shows this trace running.
5. Create a stop_tracing.cmd file and add the following information to the file. Save this to the location created in Step 2.
logman stop ExchangeDebugTraces
Method 2
Tracelog
6. Download and install tracelog from https://www.microsoft.com/downloads/details.aspx?FamilyID=55E51B3B-6C26-4CA0-ABF1-0E51D92B8298&displaylang=en
7. Create a directory called Tracing (ex. C:\tracing)
8. Copy tracelog.exe to this directory from the default install location of c:\program files(x86)\Resource Kit.
9. Create a start_tracing.cmd file and add the following information to the file. Save this to the location created in Step 2.
tracelog.exe -start ExchangeDebugTraces -f c:\Tracing\ExchangeDebugTraces.etl -seq 3500 -guid control.guid
10. Create a stop_tracing.cmd file and add the following information to the file. Save this to the location created in Step 2.
tracelog.exe -stop ExchangeDebugTraces
11. Create a control.guid file and then add the appropriate GUID for Microsoft Exchange Server 2007 tracing. Note: This GUID should be the only piece of information in this file. Save this to the c:\tracing directory.
79bb49e6-2a2c-46e4-9167-fa122525d540
12. Create an EnabledTraces.Config file and add the following information to it and then save this file to the root of your C: drive. C:\EnabledTraces.Config
TraceLevels:Pfd
Store:tagPFDServerStart
FilteredTracing:No
InMemoryTracing:No
13. To verify if these batch files work successfully, run start_tracing.cmd and then run tracelog –q ExchangeDebugTraces to check if we are now tracing
This looks good. We are now happily tracing using PFD store startup tracing.
14. Run stop_tracing.cmd to stop the tracing.
Enable Logging upon bootup
On Windows 2003 and Windows 2008 servers, we can enable this tracing when the server is rebooted by using the built-in utility called Schtasks. More information regarding this tool can be found in the following locations
Windows 2008 schtasks help
Windows 2003 schtasks help
To create a new scheduled task, open a command prompt and type the following:
schtasks /create /tn "Start Store PFD Tracing Upon Reboot" /tr "C:\tracing\start_tracing.cmd" /sc onstart /ru ""
Note: Specifying "" for the /RU switch, tells the task to run as SYSTEM.
To verify that the scheduled task has been added properly, type schtasks from a command prompt. This should return the 'TaskName" and the "Next Run Time" of "At system start up"
You could also view this in the Control Panel under Scheduled Tasks
Reboot the server and the tracing will begin before the Information Store service starts.
Once the tracing has been collected, it is important to stop tracing and then remove this schtask to prevent this tracing from occurring in the future upon reboots.
To stop tracing, simply launch the stop_tracing.cmd file in the c:\tracing directory.
To remove the scheduled event, type the following command:
schtasks /delete /TN "Start Store PFD Tracing Upon Reboot"
Unfortunately, the trace file cannot be read unless you are working with Microsoft Support representative, but at least this will give you some ways that will help catch problems as they occur and when they occur. These methods can be applied for any ExTRA tracing in general, so this is not just limited to tracing Store Startup issues.
Happy Troubleshooting!!
Mike
Comments
- Anonymous
February 05, 2016
This blog post is mainly for us Exchange support engineers but I like to surface things externally because