Share via


Using the Exchange Management Shell Command Log to Track Tasks Performed in the EMC

 

Applies to: Exchange Server 2010 SP3, Exchange Server 2010 SP2

The Exchange Management Shell Command Log records the Shell commands that you run in the EMC. In addition, after you start command logging, you can view detailed information about the commands that have run by selecting an item in the result pane. The command that was run displays in the command display box.

Looking for other management tasks related to the EMC? Check out Exchange Management Console.

What Do You Want to Do?

  • Turn on command logging

  • Turn off command logging

  • Export the command log

  • Copy the command log to the Clipboard

  • Modify the number of commands to log

  • Clear the command log

Turn on command logging

You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Exchange Management Console configuration settings" entry in the Exchange and Shell Infrastructure Permissions topic.

  1. In the EMC, select View > View Exchange Management Shell Command Log.

    Note

    You can't perform this action from the Microsoft Exchange node.

  2. Select Action > Start Command Logging.

  3. Select File > Close to close the Exchange Management Shell Command Log. The log will run in the background and continue to record all commands.

Turn off command logging

You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Exchange Management Console configuration settings" entry in the Exchange and Shell Infrastructure Permissions topic.

After you start command logging, the command log will run until you turn it off. Even if you close the program, the application will run in the background.

  1. If the Exchange Management Shell Command Log is running in the background, in the EMC select View > View Exchange Management Shell Command Log.

  2. In the Windows PowerShell Command Log, select Action > Stop Command Logging.

    Note

    After you close the command log, all logged commands are cleared. The log will not be cleared until you close the EMC.

  3. Select File > Close to close the Exchange Management Shell Command Log. The log will run in the background and continue to record all the commands.

Export the command log

You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Exchange Management Console configuration settings" entry in the Exchange and Shell Infrastructure Permissions topic.

The command log doesn't save the log of the current EMC session. If you want to save the log, you can export it to a file.

  1. If the Exchange Management Shell Command Log is running in the background, in the EMC select View > View Exchange Management Shell Command Log.

  2. Select Action > Export List. You can save the file in the following formats:

    • Text (Tab Delimited) (*.txt)

    • Text (Comma Delimited) (*.csv)

    • Unicode Text (Tab Delimited) (*.txt)

    • Unicode Text (Comma Delimited) (*.csv)

  3. Select File > Close to close the Exchange Management Shell Command Log. The log will run in the background and continue to record all the commands.

Copy the command log to the Clipboard

You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Exchange Management Console configuration settings" entry in the Exchange and Shell Infrastructure Permissions topic.

The command log doesn't save the log of the current EMC session. If you want to save specific log entries, you can select them and then copy them to the Clipboard.

  1. If the Exchange Management Shell Command Log is running in the background, in the EMC select View > View Exchange Management Shell Command Log.

  2. Select an item or multiple items in the result pane, and then select Action | Copy Commands.

  3. You can paste the command into a file, such as Notepad, by pressing CTRL+V.

  4. Select File > Close to close the Exchange Management Shell Command Log. The log will run in the background and continue to record all the commands.

Modify the number of commands to log

You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Exchange Management Console configuration settings" entry in the Exchange and Shell Infrastructure Permissions topic.

By default, the Exchange Management Shell Command Log tracks up to 2,048 entries.

  1. If the Exchange Management Shell Command Log is running in the background, in the EMC select View > View Exchange Management Shell Command Log.

  2. Select Action > Modify the Maximum Number of Windows PowerShell Commands to log.

  3. Enter a number between 1 and 32767.

  4. Click OK to save your changes and close the dialog box.

  5. Select File > Close to close the Exchange Management Shell Command Log. The log will run in the background and continue to record all the commands.

Clear the command log

You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Exchange Management Console configuration settings" entry in the Exchange and Shell Infrastructure Permissions topic.

Clearing the command log is a permanent action. After you clear it, you can't retrieve the log.

  1. If the Exchange Management Shell Command Log is running in the background, in the EMC select View > View Exchange Management Shell Command Log.

  2. Select Action > Clear Log.

  3. A dialog box displays asking you to confirm that you want to clear the log. Click Yes.

  4. Select File > Close to close the Exchange Management Shell Command Log. The log will run in the background and continue to record all the commands.

 © 2010 Microsoft Corporation. All rights reserved.