Enable Powershell logging – missing GPO

group-policyloggingpowershell-v5.0windows-server-2008windows-server-2012

I want to enable script block logging for powershell. I have installed this new feature with a windows server 2016 VM. Now i want do test this with Windows server 2012 and Windows server 2008. First I installed PowerShell 5.0.

Now I want to aktivate logging with a Group Policy. But i can't find the Policy in: Group Policy Editor: Administrative Templates → Windows Components → Windows PowerShell → Turn On PowerShell Script Block Logging

How to add this policy? or How to enable script block logging?

Best Answer

Script Block Logging can be enabled via registry:

HKLM\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging

EnableScriptBlockLogging = 1

Not sure how to do this via GPO though.