특정 사용자를 위한 Powershell 키보드 필터

특정 사용자를 위한 Powershell 키보드 필터

Microsoft의 이 페이지:https://docs.microsoft.com/en-us/windows-hardware/customize/enterprise/keyboardfilter-add-blocked-key-combinations특정 키 조합을 비활성화하는 Powershell 스크립트를 만드는 방법을 설명합니다.

관련 코드 조각은 다음과 같습니다.

function Enable-Custom-Key($Id) {
    <#
    .Synopsis
        Toggle on a Custom Key keyboard filter Rule
    .Description
        Use Get-WMIObject to enumerate all WEKF_CustomKey instances,
        filter against key value "Id", and set that instance's "Enabled"
        property to 1/true.

        In the case that the Custom instance does not exist, add a new
        instance of WEKF_CustomKey using Set-WMIInstance.
    .Example
        Enable-Custom-Key "Ctrl+V"
        Enable filtering of the Ctrl + V sequence.
#>

    $custom = Get-WMIObject -class WEKF_CustomKey @CommonParams |
        where {
            $_.Id -eq "$Id"
        };

    if ($custom) {
# Rule exists.  Just enable it.
        $custom.Enabled = 1;
        $custom.Put() | Out-Null;
        "Enabled Custom Filter $Id.";

    } else {
        Set-WMIInstance `
            -class WEKF_CustomKey `
            -argument @{Id="$Id"} `
            @CommonParams | Out-Null
        "Added Custom Filter $Id.";
    }
}


Enable-Custom-Key "Windows+U"
# etc.

그러나 특정 사용자에 대해서만 키 조합을 비활성화하는 방법이 있습니까? (즉, 동일한 컴퓨터에서 키 조합을 계속 사용할 수 있는 다른 "관리자" 사용자를 원합니다)

해당 사용자로 로그인하고 스크립트를 실행하면 그렇게 될 것이라고 생각했지만, 우선 Powershell을 관리자로 실행한 경우에만 작동하는 것 같았고, 그런 다음 다시 로그아웃한 다음 다른 사용자로 다시 로그인했습니다. 여기서도 "관리자" 사용자와 키 조합이 차단됩니다.

윈도우 10 IoT 입니다.

(BTW Powershell을 전혀 사용하지 않는 답변에 열려 있습니다. 이전에 그룹 정책 편집기를 사용하라는 지시를 받았지만 키보드 필터 섹션을 찾을 수 없습니다)

답변1

비활성화KeyboardFilterForAdministrators를 사용해 보세요.

관련 정보