Share via


Use Keyboard Filter to Block Keys in Your OS Image (Standard 8)

7/8/2014

Learn how include the Keyboard Filter in a Windows Embedded 8 Standard (Standard 8) configuration file and how to configure the filter during runtime.

Introduction

Lab Exercise Purpose

This lab shows you how to use and configure Keyboard Filter to block undesirable key presses in your OS image.

Overview of Steps

You will add the Keyboard Filter module to the base configuration file you created in the prerequisite lab Create a Configuration File by Using Image Configuration Editor, and configure Keyboard Filter during design time to block the Win+L key combination and the Shift+4 key combination.

You will also add the PowerShell and Windows Management Instrumentation (WMI) modules to your design and configure Keyboard Filter during runtime to block the Ctrl+Alt+Del and the Shift+8 key combinations.

  • Step 1: To Add Keyboard Filter to Your OS Design
    Add the Keyboard Filter module to your configuration.
  • Step 2: To Configure Keyboard Filter by Using Image Configuration Editor
    Use Image Configuration Editor (ICE) to modify configuration settings for Keyboard Filter to block Win+L and Shift+4.
  • Step 3: To Install Your OS Design on Your Device
    Install your OS design on your device.
  • Step 4: To Configure Keyboard Filter on a Running Image
    Use PowerShell and WMI on your device to modify configuration settings for Keyboard Filter to block Ctrl+Alt+Del and Shift+8.

At the End of This Lab Exercise, You Will

  • Have installed a Standard 8 image with Keyboard Filter enabled.
  • Know how to block key combinations while you are designing your OS Image by configuring Keyboard Filter in ICE.
  • Know how to block key combinations while your OS Image is running by using PowerShell and the Keyboard Filter WMI Provider to configure Keyboard Filter.

Prerequisites

To perform the steps in this lab exercise, the following things are required:

Required Hardware

Your development computer and your device must meet the minimum hardware requirements:

In addition, you must have a physical keyboard connected to your device.

Required Lab Exercises or Knowledge

The following lab exercises must be completed before you begin this lab exercise:

Knowledge of the following is recommended before you begin this lab exercise:

Lab Exercise

The following steps will guide you through this lab exercise.

Step 1: To Add Keyboard Filter to Your OS Design

In this step, you will add the Keyboard Filter module to the configuration file you created in prerequisite lab Create a Configuration File by Using Image Configuration Editor.

  1. On your development computer, start Image Configuration Editor.

  2. In ICE, click on the File menu item and select Open Configuration File.

  3. Select the LabBaseConfig.xml configuration file you created in the prerequisite lab.

  4. In ICE, in the Catalog pane, expand Features, and then expand the Lockdown node.

  5. Right click on Keyboard Filter and select Add to Configuration File.

  6. Click on the Validate menu item and select Add Required Packages.

Step 2: To Configure Keyboard Filter by Using Image Configuration Editor

In this step, you will use Image Configuration Editor (ICE) to modify configuration settings for Keyboard Filter to block Win+L and Shift+4.

  1. In ICE, in the Configuration File pane, expand Features, and then expand the Lockdown node.

  2. Click on Keyboard Filter.

  3. In the Settings pane, click on the drop down box next to Filter view by: and select 2 Offline Servicing.

  4. Scroll down the settings until you find the WindowsL setting.

  5. Click in the Value column for WindowsL, and select Blocked.

  6. Scroll up and find the CustomFilters setting.

  7. Right click on CustomFilters and select Insert New FilterRule.

  8. Expand the new FilterRule sub-setting.

  9. Under FilterRule, click in the Value column for Key, and type in “Shift+4”, without the quotes.

  10. Under FilterRule, click in the Value column for Value, and select Blocked.

Step 3: To Install Your OS Design on Your Device

In this step, you will install your OS design on your device by using the configuration file that you modified in the previous steps.

  1. In ICE, click on the File menu item and select Save Configuration File As….

  2. Select a location and enter a name for your configuration file.

  3. Follow the steps in Use a Configuration File with Image Builder Wizard, making sure to use the configuration file you created in this lab.

  4. After you have signed in to your device, verify that the Win+L and Shift+4 key combinations are blocked.

Step 4: To Configure Keyboard Filter on a Running Image

In this step, you will use PowerShell and WMI on your device to modify configuration settings for Keyboard Filter to block a predefined key (Ctrl+Alt+Del) and a custom defined key (Shift+8).

  1. Start up your device.

  2. Sign in to your device by using an administrator account.

  3. Press Ctrl+Alt+Del to bring up the Secure Authentication Screen (SAS). Press Esc to exit the SAS screen.

  4. Open a command prompt, running as an Administrator.

  5. In the command window, type the following command to start PowerShell:

    powershell
    
  6. At the PowerShell prompt, type the following commands to block a predefined key:

    $predefinedkey = [wmiclass]”\\localhost\root\standardcimv2\embedded:WEKF_PredefinedKey”
    $predefinedkey.enable(“Ctrl+Alt+Del”)
    
  7. Press Ctrl+Alt+Del and verify that the SAS screen does not appear.

  8. Type the following commands to block a custom key:

    $customkey = [wmiclass]”\\localhost\root\standardcimv2\embedded:WEKF_CustomKey”
    $customkey.add(“Shift+8”)
    
  9. Press Shift+8 and verify that the key combination is blocked.

  10. [Optional] Type the following commands to unblock the keys that you just blocked:

    $predefinedkey.disable(“Ctrl+Alt+Del”)
    $customkey.remove(“Shift+8”)
    

    Verify that the key combinations now function correctly.

Conclusion

At the end of this lab, you should have successfully added Keyboard Filter to your image, blocked a predefined key combination and a custom key combination in ICE, and used PowerShell and WMI to block a predefined key combination and a custom key combination during runtime on your device.

See Also

Other Resources

Advanced Lab Exercises
Lab Exercises