3.5 KiB
title, description, ms.author, ms.topic, ms.prod, ms.technology, author, ms.date, ms.reviewer, manager
title | description | ms.author | ms.topic | ms.prod | ms.technology | author | ms.date | ms.reviewer | manager |
---|---|---|---|---|---|---|---|---|---|
Policy CSP - WindowsPowerShell | Policy CSP - WindowsPowerShell | dansimp | article | w10 | windows | manikadhiman | 04/16/2018 | dansimp |
Policy CSP - WindowsPowerShell
WindowsPowerShell policies
WindowsPowerShell/TurnOnPowerShellScriptBlockLogging
Home | Pro | Business | Enterprise | Education | Mobile | Mobile Enterprise |
---|---|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
[!div class = "checklist"]
- User
- Device
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.
Tip
This is an ADMX-backed policy and requires a special SyncML format to enable or disable. For details, see Understanding ADMX-backed policies.
You must specify the data type in the SyncML as <Format>chr</Format>. For an example SyncML, refer to Enabling a policy.
The payload of the SyncML must be XML-encoded; for this XML encoding, there are a variety of online encoders that you can use. To avoid encoding the payload, you can use CDATA if your MDM supports it. For more information, see CDATA Sections.
ADMX Info:
- GP English name: Turn on PowerShell Script Block Logging
- GP name: EnableScriptBlockLogging
- GP path: Windows Components/Windows PowerShell
- GP ADMX file name: PowerShellExecutionPolicy.admx
Footnotes:
- 1 - Added in Windows 10, version 1607.
- 2 - Added in Windows 10, version 1703.
- 3 - Added in Windows 10, version 1709.
- 4 - Added in Windows 10, version 1803.
- 5 - Added in Windows 10, version 1809.
- 6 - Added in Windows 10, version 1903.