@echo off REM *************************************************************************************************************** REM * * REM * Example script to Configure TS Gateway clients as Network Access Protection (NAP) Enforcement Clients * REM * * REM * This example script performs the following actions: * REM * * REM * 1) Adds TS Gateway servers that you specify to the list of trusted TS Gateway servers on the client. * REM * 2) Sets the Network Access Protection service Startup type to Automatic and starts the service. * REM * * REM * When prompted, enter the names of one or more trusted TS Gateway servers. * REM * If you enter more than one name, separate each name with a \0 * REM * Example 1: Server1 * REM * Example 2: Server1\0Server2\0Server3 * REM *************************************************************************************************************** if "%1"=="" goto Usage if "%1"=="/?" goto Usage if "%1"=="-?" goto Usage echo Setting the list of trusted TS Gateway servers to %1 ... reg add "HKLM\Software\Microsoft\Terminal Server Client\TrustedGateways" /v GatewayFQDN /t REG_MULTI_SZ /d %1 /f echo Enabling the TS Gateway Quarantine Enforcement Client reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\napagent\LocalConfig\Qecs\79621 /v Enabled /t REG_DWORD /d 1 /f echo Setting the Network Access Protection service startup type to Automatic... sc config napagent start= auto echo Starting the Network Access Protection service... net start napagent goto End :Usage echo Usage: %0 TrustedGatewayList echo TrustedGatewayList - Enter the names of one or more trusted TS Gateway servers. Separate each name with a \0. echo Example 1: Server1 echo Example 2: Server1\0Server2\0Server3 goto End :End