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?
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.
According settings reference this parameter defined in
powershellexecutionpolicy.admx
group policy template.You can:
or
c:\windows\PolicyDefinitions
to domain policy definitions storage onSYSVOL\Policies\PolicyDefinitions
folder (all domain computers search policy definition in this place)or
c:\windows\PolicyDefinitions
to same folder on your workstation