Set-ProcessMitigation: -Remove does not remove path-scoped entries created with a full -Name path

Đang mở Phù hợp với người mới
#4,143 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
powershell
Lĩnh vực
documentation

Hướng nghiên cứu

Mở docset/winserver2025-ps/ProcessMitigations/Set-ProcessMitigation.md và tìm mô tả tham số -Name cùng các ví dụ về -Remove (ví dụ Set-Processmitigation -Name test.exe -Remove -Disable DEP). Thêm một ghi chú nêu rằng khi -Name là đường dẫn đầy đủ, mục nhập bị giới hạn theo đường dẫn (path-scoped) và phải được xóa dưới HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<name>. Xong nghĩa là cùng ghi chú đó xuất hiện trong các bản sao docset năm 2025, 2022 và 2019 của trang và Markdown được build không có lỗi lint.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Page: docset/winserver2025-ps/ProcessMitigations/Set-ProcessMitigation.md (same text in the 2022 and 2019 docsets); also https://learn.microsoft.com/defender-endpoint/enable-exploit-protection

The page documents -Name as <ProcessPathAndFilename.exe> and shows removal as Set-Processmitigation -Name test.exe -Remove -Disable DEP. When -Name is a full path, the cmdlet creates a path-scoped entry (UseFilter=1 on the IFEO key plus a subkey with FilterFullPath), but none of the documented removal forms delete it:

  • -Remove alone: error "Invalid input parameters".
  • -Remove -Disable <mitigation>: succeeds silently, entry unchanged.

Reproduction (elevated PowerShell 7.6 or Windows PowerShell 5.1, Windows 11 Pro 26300, ProcessMitigations module 1.0.12):

Set-ProcessMitigation -Name C:\test\app.exe -Disable ForceRelocateImages
Get-ProcessMitigation -Name C:\test\app.exe   # ForceRelocateImages: OFF; registry has UseFilter + FilterFullPath subkey
Set-ProcessMitigation -Name C:\test\app.exe -Remove                                 # Invalid input parameters
Set-ProcessMitigation -Name C:\test\app.exe -Remove -Disable ForceRelocateImages    # no error, entry still present
Get-ProcessMitigation -Name C:\test\app.exe   # still OFF

-Reset and -Force off also fail with "Invalid input parameters"; -Remove -Enable ForceRelocateImages and a bare-name -Name app.exe -Remove -Disable ForceRelocateImages succeed without removing the entry. Deleting the subkey under the IFEO key by hand is the only way to undo the exemption.

Either the cmdlet should remove such entries, or the page should state that path-scoped entries must be removed from HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<name> directly.

Also filed in feedback hub: feedback-hub:?contextid=871&feedbackid=c3ac56ef-2214-40a3-96d2-cbed787ec578&form=1&src=1

Ngôn ngữ chính
Dockerfile
Star
510
Fork
643
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MicrosoftDocs/windows-powershell-docs

Tất cả issue của MicrosoftDocs/windows-powershell-docs

Issue tương tự

Thêm issue về Documentation

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.