If you're using Microsoft's Queue Viewer tool to locate the cause of a mail flow problem, you will need to construct a message-tracking query. In doing so, the Queue Viewer console generates an Exchange Management Shell (EMS) command that you can use to initiate the query from the command line.
You might notice that the Queue Viewer console displays more information than the Exchange Management Shell does. You don't have to settle for just the information from the EMS -- you can use the EMS to create custom reports containing specific information.
For example, suppose you wanted to create a report that contains the sender's name, the recipient's name, the date the message was sent and its subject. The Exchange Management Shell doesn't display the date the messages were sent, but it does display the sender's name, the recipient's name, the subject and a few other fields we're not interested in seeing.
To customize the command's output, add the Select command and the name of the attributes that you want to view after the pipe symbol so that the end of the command looks like this:
| Select Sender, Recipients, TimeStamp, MessageSubject
You can also share this report by creating an HTML version based on the output of an Exchange Management Shell command. For example, if you want to create a report that details the time stamp and subject line of each message that was sent, append the following text to your command:
| ConvertTo-HTML –Property Sender, Timestamp, MessageSubject > C:\temp\report.htm
Keep in mind: To create an HTML report, the output folder (C:\temp, for example) must exist before running this command.
About the author: Brien M. Posey, MCSE, is a six-time recipient of Microsoft's Most Valuable Professional (MVP) award for his work with Exchange Server, Windows Server, Internet Information Services (IIS), and File Systems and Storage. Brien has served as CIO for a nationwide chain of hospitals and was once responsible for the Department of Information Management at Fort Knox. As a freelance technical writer, Brien has written for Microsoft, TechTarget, CNET, ZDNet, MSD2D, Relevant Technologies and other technology companies. You can visit Brien's personal website at www.brienposey.com.
Do you have comments on this tip? Let us know.