4

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?

spitzbuaamy
  • 143
  • 5

2 Answers2

3

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.

Strepsils
  • 5,000
  • 10
  • 14
1

According settings reference this parameter defined in powershellexecutionpolicy.admx group policy template.

You can:

or

  • Simple copy policy teplates from Windows 2016 VM c:\windows\PolicyDefinitions to domain policy definitions storage on SYSVOL\Policies\PolicyDefinitions folder (all domain computers search policy definition in this place)

or

  • Simple copy policy teplates from Windows 2016 VM c:\windows\PolicyDefinitions to same folder on your workstation
Slipeer
  • 3,295
  • 2
  • 21
  • 33