Turn on PowerShell Script Block Logging - EnableScriptBlockLogging

Information

This policy setting enables logging of all PowerShell script input to the Microsoft-Windows-PowerShell/Operational event log. If you enable this policy setting,
Windows PowerShell will log the processing of commands, script blocks, functions, and scripts - whether invoked interactively, or through automation.

If you disable this policy setting, logging of PowerShell script input is disabled.

If you enable the Script Block Invocation Logging, PowerShell additionally logs events when invocation of a command, script block, function, or script
starts or stops. Enabling Invocation Logging generates a high volume of event logs.

Note: This policy setting exists under both Computer Configuration and User Configuration in the Group Policy Editor. The Computer Configuration policy setting takes precedence over the User Configuration policy setting.

Solution

Policy Path: Windows Components\Windows PowerShell
Policy Setting Name: Turn on PowerShell Script Block Logging

See Also

https://techcommunity.microsoft.com/t5/microsoft-security-baselines/security-baseline-final-for-windows-10-v1809-and-windows-server/ba-p/701082/

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-6(10), CSCv6|16.4

Plugin: Windows

Control ID: 546adefb127a8afdc085c243ab8a2034b7da60f567ff1ac2da7c4f910b1d242a