Log everything typed and returned in PowerShell

Log everything typed in PowerShell.

John Savill

March 26, 2017

1 Min Read
Log everything typed and returned in PowerShell

Q. How can I log everything typed and returned in a PowerShell session?

A. PowerShell version 4 and above has a transcript capability that logs information about the session, commands typed and the results. This can be started with:

$trans = start-transcript

and stopped with stop-transcript.

This can be enabled for all scripts via Group Policy:

  1. Open the policy you wish to use to apply

  2. Navigate to Computer Configuration - Administrative Templates - Windows Components - Windows PowerShell

  3. Double click Turn on PowerShell Transcription

  4. Set to Enabled and by default scripts will be saved to users Documents folders or a central folder can be specified where all transcripts will be saved to (make sure you secure this folder so users cannot see other users transcripts)

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like