# Powershell スクリプトブロックロギングオン

### 1.  PowerShell スクリプトブロックロギングオン <a href="#id-1" id="id-1"></a>

### 2. Powershell Command <a href="#id-2" id="id-2"></a>

2-1. Powershell バージョン確認

`$PSVersionTable.PSVersion.Major`

2-2. Windows OS バージョン確認

`Get-WmiObject Win32_OperatingSystem | Select -Property Name`

2-3. PowerShell スクリプトブロックロギングオン “使用” (管理者権限で実行)

`reg add “HKLM\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging” /v “EnableScriptBlockLogging” /t REG_DWORD /d 1 /f`

2-4. PowerShellスクリプトブロックロギングオン “使用しない” (管理者権限で実行)

`reg delete “HKLM\SOFTWARE\Policies\Microsoft\Windows\PowerShell” /f`

2-5. PowerShellスクリプトブロックロギングオン “設定適用確認” (管理者権限で実行)

`reg query “HKLM\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging” /v “EnableScriptBlockLogging”`

WMF 5.1 インストール及び構成ダウンロードリンク

<https://docs.microsoft.com/ko-kr/powershell/scripting/windows-powershell/wmf/setup/install-configure?view=powershell-7>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plura.io/ja/faq/siem/logging/powershell.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
