PowerShell 2.0 is used by the Exchange Server 2010 Management Shell.  PowerShell 2.0 has a feature that can be used to record all of the input and output of a PowerShell session.

This is useful for administrators who want to keep track of the commands they are entering during an administration task, either simply for later reference or to assist with building PowerShell scripts for automation of tasks.

Use the Start-Transcript cmdlet to begin recording a session.  You can optionally specify the path and filename you wish to record to, and whether to append to existing files or overwrite them.

[PS] C:\>Start-Transcript
Transcript started, output file is C:Usersadministrator.ESPNETDocumentsPowerShell_transcript.20110311225255.txt

The session is simply recorded to a text file that contains all of the input commands and the output that is displayed in the Exchange Management Shell window.

PowerShell Tip: How to Record a PowerShell Session

To stop recording use the Stop-Transcript cmdlet.

[PS] C:\>Stop-Transcript
Transcript stopped, output file is C:Usersadministrator.ESPNETDocumentsPowerShell_transcript.20110311225255.txt

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. Alex

    Hey Paul,

    Start/Stop-Transcript commandlets work only in interactive Powershell sessions. They do not work in ISE or powershell scriptd envoked fro System Center Orchestrator. Most likely they also do not work is you execute scheduled powershell script ( i have not tested). Any other means to capture the output of a PowerShell session?

    Thanks!
    PS: Great site, thank you for sharing.Coming to TechEd 2014 in TX?

    1. Sadiq

      Hi Alex,

      I am new to power shell, but u can use Clip command to capture the output of a PowerShell command.

      Example:-

      get-mailbox adc@pqrst.com | clip

      Thanks…!!!!

  2. Mvd

    I have created in my $profile to automatic log all PS-activity.
    This isn`t working when doing activity in EMS.

    What can be done to achieve this?

    Thx

    1. Avatar photo
      Paul Cunningham

      Make sure it is in the profile for the admin account you use when running EMS.

Leave a Reply