Sometimes you may want to enable logging for all PowerShell actions on your system. You can perform this action by Group Policy Object (GPO), and it’s pretty simple!
Open the Group Policy Editor MMC and navigate to:
- Computer Configuration
- Administrative Templates
- Windows Components
- Windows PowerShell
Now, double click on “Turn on Module Logging” and select “Enabled“. Click on “Show” next to module names and if you want to log commands from all PowerShell modules then type “*” in the pop up window.
Click OK and apply the policy. It’s done!
Thanks for reading! You can follow me on Twitter @PrigentNico