• Home
  • Topics
    • Office 365
    • Teams
    • SharePoint
    • Exchange 2019
    • Exchange 2016
    • Exchange 2013
    • Hybrid
    • Certificates
    • PowerShell
    • Migration
    • Security
    • Azure
  • Blog
  • Podcast
  • Webinars
  • Books
  • About
  • Subscribe
    • Facebook
    • Twitter
    • RSS
    • YouTube

Practical 365

You are here: Home / Exchange Server / PowerShell Tip: How to Record a PowerShell Session

PowerShell Tip: How to Record a PowerShell Session

March 12, 2011 by Paul Cunningham 4 Comments

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.

1
2
[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.

To stop recording use the Stop-Transcript cmdlet.

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

Exchange Server Automation, PowerShell, Scripting

Comments

  1. Alex says

    December 19, 2013 at 1:43 am

    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?

    Reply
    • Sadiq says

      January 9, 2014 at 12:21 am

      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…!!!!

      Reply
  2. Mvd says

    April 16, 2013 at 9:30 pm

    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

    Reply
    • Paul Cunningham says

      April 17, 2013 at 10:30 am

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

      Reply

Leave a Reply Cancel reply

You have to agree to the comment policy.

Recent Articles

  • The Practical 365 Weekly Update: S2, Ep 8 – What to expect in 2021, Solarigate, TLS in Exchange and new Teams updates
  • Security updates released for Exchange and SharePoint Servers 2010 to 2019
  • The Practical 365 Weekly Update: S2, Ep 7 – Urgent Exchange security updates, new Teams features launch
  • How to train your users against threats with Attack Simulation Training
  • Fall 2020 roundup of compliance updates
Practical 365

Related Posts

Related Posts

Training Courses

  • Configuring and Managing Office 365 Security
  • Office 365 Admin Playbook
  • Exchange 2016 Exam 70-345
  • Managing Exchange Mailboxes and Distribution Groups in PowerShell
  • More Training Courses...

Recommended Resources

  • Office 365 Security Resources
  • Office 365 Books
  • Exchange Server Books
  • Exchange Server Migrations
  • Exchange Analyzer
  • Digicert SSL Certificates

About This Site

Practical 365 is a leading site for Office 365 and Exchange Server news, tips and tutorials. Read more...

Find out more about advertising with us.

Contact us


Subscribe to our newsletter
  • Facebook
  • Twitter
  • RSS
  • YouTube

Copyright © 2021 Quadrotech Solutions AG · Disclosure · Privacy Policy
Alpenstrasse 15, 6304 Zug, Switzerland