Compartilhar via


Repair Remote Desktop Gateway

Published: March 10, 2011

Updated: March 17, 2011

Applies To: Windows Small Business Server 2011 Standard

Problem: Windows SBS 2011 Standard installs and configures the Remote Desktop Gateway role for use with the Remote Web Access (RWA) website. However, this role is not listed in Server Manager because the Windows SBS 2011 Standard setup does not install the Remote Desktop Gateway Manager. If you mistakenly install and configure the Remote Desktop Gateway role from Server Manager, RWA may not perform properly.

Solution: Re-install the Remote Desktop Gateway role and restore the initial configuration.

To re-install the Remote Desktop Gateway role and restore the configuration

  1. Perform the following steps to uninstall the Remote Desktop Gateway role:

    1. Click Start, click Administrative Tools, and then click Server Manager.

    2. Expand Roles, right-click Remote Desktop Services and click Remove Role Services.

    3. On the Role Services page, unselect Remote Desktop Gateway and click Next.

    4. On the Confirmation page, click Remove.

    5. After the role is removed, close the wizard and restart the machine.

  2. Perform the following steps to re-install the Remote Desktop Gateway role:

    1. Open a command prompt with administrative privilege. See To open a Command Prompt window as an Administrator.

    2. At the command prompt, type dism.exe /online /Enable-Feature:Gateway /Quiet /NoRestart and press ENTER.

  3. To ensure that PowerShell can correctly load the .NET Framework 4 assembly, at the command prompt type reg add hklm\software\microsoft\.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 1 and press ENTER

  4. Open Notepad, copy and paste the following content, and save it as %programfiles%\Windows Small Business Server\bin\ConfigureRDP.xml.

    <?xml version="1.0" encoding="utf-8"?>
    <TME xmlns="https://tempuri.org/TME.xsd">
      <TaskLists>
        <TaskList Id="ConfigureRDPTaskList" >
          <Tasks>
            <Task Id="ConfigureTSGCertificateTask" Type="Microsoft.WindowsServerSolutions.IWorker.Tasks.ConfigureTSGCertificateTask" Assembly="IWorkerConfig.dll" />
            <Task Id="ConfigureTSProxyTask" Type="Microsoft.WindowsServerSolutions.IWorker.Tasks.ConfigureTSProxyTask" Assembly="IWorkerConfig.dll" />
          </Tasks>
        </TaskList>
      </TaskLists>
    </TME>
    
  5. Open Notepad, copy and paste the following content, and save it as %programfiles%\Windows Small Business Server\bin\ConfigureRDP.ps1.

    [System.Reflection.Assembly]::LoadFrom(".\TaskManagementEngine.dll") | out-null;
    $scheduler = new-object Microsoft.WindowsServerSolutions.TaskManagement.TaskScheduler("ConfigureRDP.xml");
    $scheduler.RunTasks("ConfigureRDPTaskList", "ConfigureRDPTaskStatus.xml") | out-null;
    Write-Host "The configuration is complete. Check file """ $scheduler.ResultsFileName """ for result.";
    
  6. At the command prompt, type powershell .\ConfigureRDP.ps1 and press ENTER.

  7. Open the result file and check the task status to see if the tasks are completed successfully. Below is a sample result file from a successful run.

    <?xml version="1.0"?>
    <TaskStatusResults xmlns:xsd="https://www.w3.org/2001/XMLSchema" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance">
      <TaskStatus Time="2010-12-09T00:56:45.3821718+08:00" Success="true" Continue="true" Expose="false" Reboot="false" RebootNow="false" Completed="true" TaskListId="ConfigureRDPTaskList" Warning="false" StatusId="2bbd02c6-721b-4749-83dc-3c5a2aef6ec9" UserStatus="Active">
        <Task Id="ConfigureTSGCertificateTask" Type="Microsoft.WindowsServerSolutions.IWorker.Tasks.ConfigureTSGCertificateTask" Assembly="IWorkerConfig.dll" AlwaysReboots="false" />
      </TaskStatus>
      <TaskStatus Time="2010-12-09T00:57:02.3640699+08:00" Success="true" Continue="true" Expose="false" Reboot="false" RebootNow="false" Completed="true" TaskListId="ConfigureRDPTaskList" Warning="false" StatusId="9f1401b4-892c-4fe6-8bda-842033248a93" UserStatus="Active">
        <Task Id="ConfigureTSProxyTask" Type="Microsoft.WindowsServerSolutions.IWorker.Tasks.ConfigureTSProxyTask" Assembly="IWorkerConfig.dll" AlwaysReboots="false" />
      </TaskStatus>
    </TaskStatusResults>
    
  8. Remove the registry key added in step 3. To do this, open a command prompt with administrative privilege, type: reg delete hklm\software\microsoft\.netframework /v OnlyUseLatestCLR /f, and then press ENTER.

Note

If you do not remove the registry key, some Exchange Server features such as the Exchange Server Management Console may not function correctly.