Развертывание rds в windows server 2019

Теперь вы можете установить службу удаленных рабочих столов (RDS) на Windows Server 2019, в доменной среде с двумя серверами.

Установка службы удаленных рабочих столов (RDS) на Windows Server 2019 состоит из многих шагов, но в действительности это очень просто. Из статьи вы узнаете о том, как установить эту службу в доменной среде, которая требует наличия двух серверов.

Предварительные условия

Перед началом установки RDS необходимо убедиться, что выполняются два требования,  а именно:

  • все серверы подключены к домену;
  • есть по крайней мере два доступных сервера.

Необходимо, чтобы было именно два сервера, так как для роли RD Licensing, согласно лучшим практикам Microsoft, требуется отдельный сервер. В данной инструкции мы будем использовать для этой роли контроллер домена, что не вполне соответствует лучшим практикам, но мы делаем это, чтобы упростить демонстрационную установку.

Установка базовых ролей службы удаленных рабочих столов

Для начала мы добавим к основному RDS-серверу следующие роли:

  • RD Connection Broker (Посредник подключений к удаленному рабочему столу);
  • RD Web Access (Веб-доступ к удаленным рабочим столам);
  • RD Session Host (Узел сеансов удаленных рабочих столов).

Пошаговая установка

  1. В диспетчере сервера на основном RDS-сервере, на котором выполняется установка, откройте Add Roles and Features Wizard (мастер добавления ролей и компонентов) и выберите Remote Desktop Services installation(установку службы удаленных рабочих столов).

2. Для этой инструкции мы используем опцию Quick Start (Быстрый старт), но если вам требуется больше контроля над процессом установки, вы можете выбрать Standard Deployment (Стандартную установку), которая позволяет редактировать большее количество настроек.

3. Далее мы выбираем Session-based desktop deployment (Установка рабочих столов на основе сеансов), так как это стандартная модель подключения к удаленным приложениям и удаленным рабочим столам, используемая в большинстве установок RDS.

4. В разделе Server Selection (Выбор сервера), выберите сервер, на который мы устанавливаем RDS.

5. Чтобы начать установку, выберите Restart the destination server automatically if required (Автоматический перезапуск конечного сервера в случае необходимости) и кликните на Deploy (Установить).

6. Проверьте, что все роли успешно установлены перед тем, как переходить к следующим шагам.

Добавление дополнительного сервера

В этой инструкции мы используем доменный контроллер в качестве сервера лицензирования удаленных рабочих столов, но для упрощения установки этой роли мы можем добавить дополнительный сервер в диспетчере серверов.

  1. Чтобы добавить дополнительный сервер, кликните правой кнопкой мыши на All Servers (Все серверы), выберите Add Servers (Добавление серверов), а затем выберите нужный сервер в Active Directory.

2. Перейдите на экран Remote Desktop Services (Службы удаленных рабочих столов) и кликните на зеленом плюсе над RD Licensing (Лицензирование удаленных рабочих столов).

3. Откроется окно Add RD Licensing Servers (Добавление серверов лицензирования удаленных рабочих столов), в котором вы сможете выбрать дополнительный сервер для роли RD Licensing.

4. Кликните на Add (Добавление), чтобы установить роль на дополнительный сервер.

5. Убедитесь, что установка завершена и зеленый плюс над RD Licensing заменен на соответствующий значок.

Добавление роли RD Gateway Role

Теперь нам нужно добавить RD Gateway Role (роль службы шлюза удаленных рабочих столов) к основному RDS-серверу.

  1. На экране Remote Desktop Services (Службы удаленных рабочих столов) кликните на зеленом плюсе над RD Gateway (Шлюз удаленных рабочих столов).
  2. Выберите основной RDS-сервер для установки этой роли.

3. Присвойте самоподписанному SSL-сертификату полное доменное имя.

4. Кликните Next и потом Add, чтобы установить роль на основной RDS-сервер.

Настройка параметров установки

Теперь, когда все роли установлены, можно перейти к настройке параметров установки.

  1. Откройте экран Remote Desktop Services и в выпадающем списке Tasks (Задания) кликните на Edit Deployment Properties (Редактирование параметров установки).

2. На экране RD Gateway оставьте настройки по умолчанию и кликните на пункте меню RD Licensing.

3. Выберите Per User (По количеству пользователей) на экране RD Licensing. Вы можете выбрать любую из двух опций, но в целях обучения мы выбираем Per User.

4. Обратите внимание на URL на экране RD Web Access (Веб-доступ к удаленным рабочим столам). Позже мы будем его использовать для доступа к установленным приложениям.

5. В целях тестирования можно оставить сертификаты как Not Configured (Не сконфигурированные) и нажать OK, чтобы сохранить параметры установки. 

Если вы хотите сконфигурировать сертификат, вам придется делать это для каждой службы роли по отдельности.

Верификация службы удаленных рабочих столов

По умолчанию после установки создается QuickSessionCollection, куда входят Calculator, WordPad и Paint в качестве удаленных приложений. Мы можем использовать это для тестирования установки RDP.

  1. Для тестирования IIS перейдите по ссылке, представленной на экране RD Web Access, или используйте https://localhost/rdweb/, если вы находитесь на RDP-сервере.

2. Подключитесь к сеансу IIS RDS с помощью доменной учетной записи.

3. Запустите удаленное соединение: то, которое вы сконфигурировали, или удаленное приложение по умолчанию.

Установка службы удаленных рабочих столов может состоять из многих шагов, но после изначальной настройки ее легко конфигурировать и использовать. Удаленные приложения обеспечивают значительную гибкость, как и возможность настраивать коллекции RDP-подключений для предложения их пользователям.

Обновлено 03.08.2020

rds windows server 2019 logoДобрый день! Уважаемые читатели и гости IT блога Pyatilistnik.org. В прошлый раз мы с вами разобрали ситуацию, когда ваш жесткий диск виделся в формате RAW и не позволял получить доступ к данным, мы это благополучно решили. Сегодня мы рассмотрим задачу установки отказоустойчивой терминальной фермы Remote Desktop Services, где посредники подключений (RD Connection Broker) работают в режиме высокой доступности (High Availability) и все это дело будет работать на Windows Server 2019 в связке с хостами подключений (RDSH) на базе Windows Server 2016. Давно хотелось у себя на сайте иметь такую инструкцию, тем более что давно стояла задача перехода с W2012R2.

Постановка задачи

Необходимо организовать высоко доступную ферму RDS (Remote Desktop Services), где в качестве брокеров подключения будут выступать операционные системы с Windows Server 2019. В качестве хостов подключений, на которых будут работать конечные пользователи требуется иметь операционную систему Windows Server 2016. Развернуть сервер лицензирования, раздающий лицензии на пользователя или устройства. Чем хорошо использовать в качестве посредников подключений именно Windows Server 2019, все просто, когда большинство клиентского программного обеспечения станет поддерживаться данной ОС, можно будет легко вывести из эксплуатации сервера с W2016 и заменить их на более новые.

Требования по развертыванию RD Connection Broker High Availability

Прежде, чем мы начнем к поэтапному приготовлению к установке вашей отказоустойчивой RDS ферме, я бы хотел выделить пункты, которые нам потребуется выполнить.

  1. Наличие двух серверов или виртуальных машин с Windows Server 2019, на которые мы будем устанавливать роли посредников подключений (RD Connection Broker)
  2. Создание группы безопасности Active Directory, в которую необходимо поместить сервера RD Connection Broker
  3. Установка MS SQL 2012 и выше, для базы Connection Broker, лучше в режиме Always On.
  4. Предоставление группы безопасности с серверами RD Connection Broker, прав на создание баз данных
  5. Установка на сервера посредников подключений SQL Server Native Client, если SQL 2016, то Client Tools Connectivity
  6. Создание записи в DNS, которое будет использоваться в качестве имени RDS фермы, с помощью механизма DNS round robin.
  7. Настройка алиаса в cliconfg.exe для SQL базы и упрощенного переноса в случае необходимости
  8. Подготовка одного или более сервера с Windows Server 2016 для установки роли Remote Desctop Session Host и RD Web
  9. Выпуск SSL сертификата безопасности
  10. Создание и настройка коллекции на RDS ферме
  11. Установка и настройка сервера лицензирования терминальных сессий
  12. Дополнительные правки реестра для подключений через стандартное приложение «Подключение к удаленному рабочему столу»

Тестовый стенд с виртуальными машинами фермы Remote Desktop Services

  1. Две виртуальные машины с установленной Windows Server 2019, RDCB01.root.pyatilistnik.org (ip-адрес 192.168.31.20) и RDCB02.root.pyatilistnik.org (ip-адрес 192.168.31.21)
  2. Две виртуальные машины с установленной Windows Server 2016, RDHC01.root.pyatilistnik.org
  3. (ip-адрес 192.168.31.22и RDSH02.root.pyatilistnik.org (ip-адрес 192.168.31.23)
  4. Виртуальная машина SQL01.root.pyatilistnik.org с установленной MS SQL 2016, но напоминаю у вас должен быть отказоустойчивый кластер SQL.

Стандартная установка RDS фермы в Windows Server 2019

Перед тем, как мы сделаем высокодоступное подключение к ферме Remote Desktop Services, нам необходимо произвести установку стандартной конфигурации служб удаленных рабочих столов, включающей в себя:

  • Установку посредника подключений (RD Connection Broker) на сервер RDCB01.root.pyatilistnik.org
  • Установка роли удаленного подключения (RD Session Host) на сервера RDHC01.root.pyatilistnik.org и RDCH02.root.pyatilistnik.org
  • Установка роли RD Web на сервера RDHC01.root.pyatilistnik.org или RDCH02.root.pyatilistnik.org, если планируете использовать RemoteApp, то ставьте на все нужные хосты.

Создание пула серверов на сервере посредника подключений (RD Connection Broker)

Пул серверов, это удобное объединение серверов в общий список для быстрого управления и развертывания на них ролей и компонентов. Все манипуляции производятся из единой консоли управления «Диспетчер серверов». Откройте оснастку «Диспетчер серверов» раздел «Все серверы». Щелкните по нему правым кликом и нажмите «Добавление серверов».

Напоминаю, что делать вы это должны от имени учетной записи, у которой есть права на данные сервера и ваш брандмауэр должен пропускать данные подключения

Добавление серверов в пул на сервере посредника подключений

На вкладке Active Directory вам необходимо указать в каком домене вы будите производить поиск, в поле «Имя (Общие)» находим нужные вам сервера.

Добавление серверов в список диспетчера серверов

Выбираем нужные сервера и переносим их в раздел «Выбрано».

Добавление серверов для установки Remote Desktop Services High Availability

Нажимаем «Ok».

Подготовка серверов для установки Remote Desktop Services High Availability

В итоге в вашей оснастке «Диспетчер серверов» вы увидите все добавленные хосты. которые будут участниками Remote Desktop Services High Availability на Windows Server 2019.

Если у ваших серверов будет статус «В сети: счетчики производительности не запущены», то запустите их через правый клик

Запуск счетчиков производительности RDS

В результате все должно быть в статусе «В сети».

Успешно добавленные сервера в диспетчер серверов Windows Server 2019

Стандартное развертывание службы удаленных рабочих столов

Перед тем как создавать высоко доступную ферму RDS, вы должны произвести базовую инсталляцию, а именно нам необходимо установить три роли на текущие сервера, для этого в правом верхнем углу выберите пункт «Управление — Добавить роли и компоненты«.

Стандартный тип развертывания — это лучший метод развертывания, и вы должны выбрать этот тип развертывания в производственной среде

Базовая установка RDS фермы на Windows Server 2019

В мастере добавления ролей выберите пункт «Установка служб удаленных рабочих столов (Remote Desktop Services Installation)» и нажимаем далее.

Установка служб удаленных рабочих столов

Выбираем первый пункт «Стандартное развертывание (Standard Deployment)» — данный тип развертывания позволяет устанавливать роли Remote Desktop Services на нескольких серверах одновременно.

Стандартное развертывание служб удаленных рабочих столов

Выбираем второй пункт «Развертывание рабочих столов на основе сеансов (Session-based desktop deployment)»

Это развертывание рабочих столов на основе сеансов позволяет пользователям подключаться к коллекциям сеансов, включающим опубликованные удаленные приложения RemoteApp и рабочие столы, основанные на сеансах

Развертывание рабочих столов на основе сеансов

Список компонентов устанавливаемых при стандартной конфигурации RDS фермы. Тут будет установлен:

  • Посредник подключений к удаленным рабочим столам (Connection Broker)
  • Веб-доступ к удаленным рабочим столам
  • Узел сеансов удаленных рабочих столов

Список устанавливаемых компонентов Remote Desktop Services

На следующем шаге вам нужно выбрать и перенести в правую область сервер, который будет нести на себе роль «Посредник подключений к удаленным рабочим столам (RD Connection Broker)». В моем примете, это первый сервер RDCB01.root.pyatilistnik.org.

Второй сервер на данном этапе добавлять не нужно

Установка роли Посредник подключений к удаленным рабочим столам на выбранный сервер

Далее у нас идет выбор сервера для установки роли «Веб-доступ к удаленным рабочим столам (RD Web Access)», так как я пока не планирую использовать веб доступ RemoteApp, а настрою это потом, то я воспользуюсь галкой «Установить службу веб-доступа к удаленным рабочим столам на сервере посреднике подключений к удаленному рабочему столу (Install the RD Web Access role service on the RD Connection Broker server)»

Данную роль нельзя пропустить в мастере стандартной установки служб Remote Desktop Services, но она нам пригодится еще очень сильно

Установка роли веб доступ к удаленным рабочим столам

Последним идет пункт по установке роли на сервера к которым вы будите непосредственно подключаться, выбираем нужные сервера и инсталлируем на них роль «Узел сеансов удаленных рабочих столов (RS Session Host)». В моем примере, это два сервера rdsh01 и rdsh02.

Установка роли RS Session Host

Процесс установки ролей подразумевает, что потребуется перезагрузка сервера, для этого вам необходимо выставить галку «Автоматически перезапускать конечный сервер, если это потребуется (Restart the destination server automatically if required )» и нажать кнопку «Развернуть«

Подтверждение на перезагрузку серверов при установке ролей Remote Desktop Services

Начинается процесс установки службы удаленных рабочих столов, может занимать несколько минут.

Процесс установки службы удаленных рабочих столов

У вас должна произойти успешная установка службы «службы удаленных рабочих столов». Все необходимые сервера будут перезагружены.

Успешная установка службы "службы удаленных рабочих столов"

Давайте убедимся, что все серверы получили свои роли. Для этого на сервере, где вы добавляли сервера в оснастку «Диспетчер серверов (Производили установку)», откройте оснастку и перейдите в раздел «Службы удаленных рабочих столов».

раздел "Службы удаленных рабочих столов".

На вкладке «Общие сведения» посмотрите в разделе «Серверы развертывания», кто и какие роли себе установил.

Обзор развертывания служб Remote Desktop Services

Перейдите в раздел «Коллекции» и убедитесь, что список пуст, но зато присутствуют два ваших хоста узла сеансов удаленных рабочих столов, к котором будут подключаться конечные пользователи. Они будут иметь статус «Истина (True)», что говорит о разрешении подключаться (Режим стока выключен)

Просмотр коллекций в Remote Desktop Services

Следующим шагом мы создадим новую коллекцию для подключения к службам Remote Desktop Services High Availability на Windows Server 2019.

Создание коллекции для отказоустойчивой терминальной фермы

Следующим шагом идет создание коллекции или коллекций, к ресурсам которых будут подключаться пользователи. Коллекция Remote Desktop Services — это некое объединение серверов RDSH, RD Web под определенные задачи, отделы и другие варианта разграничения. Приведу пример, у вас есть отдел продаж, есть отдел разработчиков 1С. Логично предположить, что пользователям из отдела продаж не нужны всякие программные продукты для разработчиков, а разработчикам не нужен специфический софт, который установлен у отдела продаж. Отсюда следует, что будет создано две коллекции, и каждая из них будет иметь на борту, только свои определенные сервера «Службы удаленных рабочих столов», со своим набором программного обеспечения, а доступ к коллекциям будет осуществляться исключительно по группам безопасности Active Directory.

Так, что подытожим, коллекции RDS призваны решать две задачи:

  • Они позволяют нам разделять RD Session Hosts на отдельные фермы
  • Второе, что они делают, это позволяют администраторам организовывать ресурсы, по отделам или другим критериям

Для создания новой коллекции сеансов службы удаленных рабочих столов, выберите  раздел «Коллекции» и нажмите кнопку «Задачи — Создать коллекцию сеансов«

Создание коллекции сеансов RDS

Придумываем любое имя для вашей коллекции, в моем примере это root-collection

Задаем имя коллекции Remote Desktop Services

Теперь вам необходимо определиться какие серверы с ролью узлов сеансов (RDSH) вам нужно включить в коллекцию, у меня это RDSH01 и RDSH02

Добавление узлов RDSH в коллекцию

Указываем каким пользователям или группам разрешен доступ к данной терминальной ферме, я удалю группу «Пользователи домена» и добавлю другую.

Настройка доступа к коллекции RDS

У меня получился вот такой список доступа, потом его так же можно изменить.

Настройка доступа к Remote Desktop Services

Я снимаю галку «Включить диски профилей пользователей» так как не планирую использовать UDP диски.

Отключаю "Включить диски профилей пользователей"

Смотрим сводную информацию по создаваемой коллекции и нажимаем «Создать».

Проверка свойств создаваемой коллекции RDS

Дожидаемся создания коллекции службы удаленных рабочих столов.

Успешно созданная коллекция Remote Desktop Services

Не удается настроить сервер удаленных рабочих столов. Недопустимая операция

В общем списке у вас будет ваша коллекция.

Список коллекций RDS фермы

Про описание свойств коллекции RDS я уже писал пост, можете к нему обратиться. Теперь у системного администратора, кто первый раз развернул стандартную установку службы удаленных рабочих столов возникает вопрос, как ему подключиться к новой коллекции и это правильный вопрос, так как если вы сейчас попытаетесь подключиться  брокеру, то вас не перекинет на хост из коллекции, вы просто попадете на сам RDCB хост. Чтобы это поправить нам нужно сделать две вещи:

  1. Скачать специальный файл RDP с RD Web хоста
  2. Поправить ветку реестра на сервере с ролью RD Connection Broker

Настройка RD Connection Broker для подключений к ферме RDS

Как я писал выше в текущей конфигурации посредник подключений к удаленным рабочим столам вас не будет перебрасывать в коллекцию, он просто будет подключаться к брокеру по RDP, ниже мы это поправим.

Для подключения к ферме Remote Desktop Services в отказоустойчивой конфигурации создают две записи DNS и направляют их на сервера с ролью RD Connection Broker, кто-то балансирует иначе, но мы в данном окружении воспользуемся именно DNS и механизмом перебора Round Robin. Откройте оснастку и создайте A-запись с нужным именем вашей RDS фермы у меня это будет DNS имя «terminal«.

Я пока создам одну A-запись с таким именем и в качестве IP-адреса укажу адрес моего первого сервера с ролью RD Connection Broker.

Создание записи dns для подключения к отказоустойчивой фермы RDS

В запись terminal.root.pyatilistnik.org успешно создана.

Создание имени для подключения к Remote Desktop Services

Проверяем ее через утилиту PING

Проверка узла через утилиту Ping

Теперь, чтобы наш сервер посредник подключений к удаленным рабочим столам перебрасывал нас на RDSH сервера, нам необходимо подключиться к RD Web серверу и скачать RDP-файл с конфигурацией. Данный файл будет нести в себе параметры, о наименовании коллекции, при обращении к которой вы попадете на один из конечных серверов.

Напоминаю, что в моем тестовом окружении сервером веб-доступа к удаленным рабочим столам выступает брокер RDCB01.root.pyatilistnik.org

Стандартный адрес для подключения к вашему серверу RD Web, это:

https://dns имя вашего сервера с данной ролью/rdweb в моем примере https://rdcb01.root.pyatilistnik.org/rdweb

Проверить наличие данного адреса вы можете открыв диспетчер IIS.

RDweb сайт на IIS

У вас должна открыться вот такая страница с авторизацией.

Запуск RDWeb страницы

Теперь нам нужно получить значение loadbalanceinfo из свойств вашей коллекции, оно будет прописано в реестре брокеров. Для этого выполним публикацию приложения RemoteApp. Переходим в коллекцию службы удаленных рабочих столов и находим раздел «Удаленные приложения RemoteApp«. Нажимаем на задачи и произведем публикацию удаленного приложения RemoteApp.

Публикация RemoteApp приложения

Выберите для примера обычный калькулятор

Публикация приложения в Remote Desktop Services

Нажимаем «Опубликовать«.

Публикация удаленного приложения в Remote Desktop Services

Дожидаемся публикации приложения в коллекции Remote Desktop Services.

Успешно опубликованное приложение RemoteApp

Далее вы переходите в веб интерфейс RDWEb и авторизуетесь, у вас будет доступно приложение калькулятор. Щелкните по нему и у вас будет запущено скачивание RDP пакета.

Запуск приложения RemoteApp

Теперь полученный файл RDP нужно открыть через блокнот.

Открытие файла RDP через блокнот

Вам нужно найти строку loadbalanceinfo:s:tsv://MS Terminal Services Plugin.1.root-collection, она то нам и нужна для прописывания ее в реестре сервера несущего роль посредника подключений к удаленным рабочим столам (Connection Broker).

Строка подключения к коллекции RDS

Переходим на сервер с ролью RD COnnection Broker и открываем реестр Windows. Переходим в раздел:

HKLMSYSTEMCurrentControlSetControlTerminal ServerClusterSettings

Создаем тут ключ реестра с типом REG_SZ (Строковый) и именем DefaultTsvUrl. В качестве содержимого вставляем tsv://MS Terminal Services Plugin.1.root-collection

Настройка RDS брокера

Настройка сервера посредника подключений к удаленным рабочим столам

Перезагрузите на всякий случай ваш брокер. Пробуем теперь произвести подключение по имени terminal.root.pyatilistnik.org.

Проверка подключения к терминальной ферме

Как видите нам ответил rdcb01.root.pyatilistnik.org

Проверка работы службы удаленных рабочих столов

Но как и было задумано посредник подключений к удаленным рабочим столам перекину нас на конечный хост с ролью RDSH. Я для теста сделал три подключения, все отлично работает. Можно сказать, что мы успешно установили и настроили стандартную Remote Desktop Services ферму на базе Windows Server 2019. Теперь можно превращать ее в высоко доступную, о чем и пойдет речь ниже.

Успешное подключение к RDS ферме

Создание группы безопасности для RD Connection Broker

Следующим шагом нам необходимо в Active Directory создать группу безопасности в которую мы поместим наши сервера с ролью RD Connection Broker. Необходимо, это для того, чтобы мы этой группе безопасности назначили необходимые права на нашем SQL сервере.

Открываем оснастку ADUC и создаем в нужном вам расположении группу безопасности RD-Connection-Broker. Я выставлю область действия группы (Локальная в домене).

Создание группы безопасности для RD Connection Broker

Добавим в группу RD-Connection-Broker два сервера с ролью посредника подключений к удаленным рабочим столам. В моем случае, это RDCB01 и RDCB02.

Не забудьте перезагрузить оба сервера, чтобы обновился их ACL с членством в группе

Группа безопасности для RD Connection Broker

Установка SQL Native Client

Следующим шагом вам необходимо на обоих серверах с ролью RD Connection Broker установить бесплатного клиента SQL Native Client, это необходимое требование. Где скачать SQL Native Client и как его установить я подробно рассказывал, на этом я останавливаться не буду, посмотрите по ссылке.

Установка и настройка MS SQL 2016

Следующим подготовительным требованием идет установка общей базы для наших брокеров, в моем примере это будет MS SQL 2016 Standard. Сам процесс инсталляции я подробно разбирал, так что так же советую посмотреть мою статью. Еще я вам советую делать всегда вашу базу данных отказоустойчивой, в режиме Always On.

В этой статье описано, как установить и настроить роль терминального сервера Remote Desktop Session Host в рабочей группе (без домена Active Directory) и без всех дополнительных ролей (Connection Broker, Remote Desktop Web Access, RDS Gateway).

Windows Server с ролью RDSH (Remote Desktop Session Host) позволяет одновременно подключаться к серверу по RDP нескольким пользователям (по умолчанию в Windows Server разрешены только 2 административных RDP подключения). Для каждого пользователя создается отдельная сессия и он получает доступ к персональному рабочему столу

Если вы планируете используете отдельный RDS сервер в рабочей группе, имейте в виду, что его функциональность ограничена. Он не может масштабироваться до полноценной RDS фермы Windows Server, нельзя создавать отдельные коллекцию или RemoteApp, нет брокера, нельзя использовать User Profile Disks для профилей пользователей, отсутствуют средства централизованного управления, при проведении операций обслуживания RDP сервис будет недоступен.

Содержание:

  • Установка роли Remote Desktop Services в Windows Server 2019
  • Настройка роли Remote Desktop Licensing, добавление RDS лицензий (CAL)
  • Настройка роли Remote Desktop Session Host в рабочей группе

Установка роли Remote Desktop Services в Windows Server 2019

Предполагаем, что вы уже установили сервер с Windows Server и выполнили базовые настройки (ip адрес, имя сервера, время/дата, установили обновления и т.д.). Теперь можно установить службу RDS.

Для этого можно использовать Server Manager или PowerShell.

Для установки службы RDS через Server Manager нужно выбрать Role-based or feature-based installation -> Server roles -> Remote Desktop Services -> в компонентах RDS выберите службы Remote Desktop Session Host и Remote Desktop Licensing (согласитесь с установкой компонентов RSAT для управления этими ролями).

Server Manager установка Remote Desktop Services

Обратите внимание, что если в Server Manager вы выбрали тип установки Remote Desktop Services installation, то в режиме Standard deployment и Quick Start установщик дополнительно установит роли RD Connection Broker и Web Access. В нашем случае все эти роли излишни, т.к. мы ставим стендалон RDS сервер. установки Remote Desktop Services installation

Также вы можете установить нужные роли Windows Server с помощью PowerShell:

Install-WindowsFeature -Name RDS-Licensing, RDS-RD-Server –IncludeManagementTools

Установка RDS-Licensing, RDS-RD-Server в Windows Server 2019 через PowerShell

Проверьте, какие RDS роли установлены на сервере:

Get-WindowsFeature -Name RDS* | Where installed

powershell просмотр устаовленных ролей RDS в Windows Server 2019

Перезагрузите сервер:

Restart-Computer

Настройка роли Remote Desktop Licensing, добавление RDS лицензий (CAL)

Следующий этап – настройка роли Remote Desktop Licensing, которая обеспечивает лицензирование RDP подключений пользователей к вашему RDS серверу. Вы можете установить и активировать роль Remote Desktop Licensing на данном хосте (если он у вас один), либо можете разместить роль RDLicensing на другом сервере. Один сервер с ролью RDS Licensing можете выдавать лицензии неограниченному количеству RDSH хостов.

Если вы решили использовать локальный сервер RDLicensing, активируйте сервер лицензий RDS и установите клиентские лицензии (RDS CAL) согласно гайду по ссылке.

В рабочей группе нужно использовать RDS CAL типа Per Device. Если ваш сервер лицензирования выдает только Per User лицензии, то пользователи при RDP подключении к серверу будут получать ошибку:

Remote Desktop License Issue
There is a problem with your Remote Desktop license, and your session will be disconnected in 60 minutes.

Remote Desktop License issue - your session will be disconnected in 60 minutes.

Настройка роли Remote Desktop Session Host в рабочей группе

Перейдите в Control Panel -> System and Security -> Administrative Tools -> Remote Desktop Services -> Remote Desktop Licensing Diagnoser. Обратите внимание, что ваш сервер еще не настроен на получение RDS CAL лицензий с сервера лицензирования. Об этом свидетельствуют надписи:

  • The licensing mode for the Remote Desktop Session Host server is not configured
  • Number of licenses available for clients:
    0

Remote Desktop Licensing Diagnoser не задан сервер лицензирования

Если вы не нацелите ваш RDSH сервер на сервер лицензирования RDS, который может выдать пользователям лицензии, ваш сервер будет находится в триальном режиме. В этом режиме службы RDS работают в течении всего 120 дней (при каждом подключении в трее будет появляться сообщение “
Служба удаленных рабочих столов перестанет работать через xxx дней
”). После окончания grace периода ваши пользователи не смогут подключится к RDS с ошибкой:

Remote session was disconnected because there are no Remote Desktop client access licenses available for this computer.

Основной недостаток роли Remote Desktop Services в Windows Server 2019 при установке в рабочей группе – у вас по сути нет никаких удобных инструментов управления ролью RDS. Любые настройки роли RDSH придется выполнять через редактор локальных групповых политик
gpedit.msc
.

[/alert]

В локальной GPO нужно настроить параметры лицензирования RDS:

  1. Перейдите в раздел GPO Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Licensing;
  2. Установите параметра Set the Remote Desktop licensing mode: Per Device;
  3. В Use the specified Remote Desktop license servers укажите адрес сервера, на котором установлен сервер RDLicensing. Если сервер лицензии установлен локально, укажите localhost или 127.0.0.1; настройка параметров лицензирования RDS сервера через локальную групповую политику
  4. Обновите локальные политики, и запустите Remote Desktop Licensing Diagnoser. Убедитесь, что он видит ваши RDS CAL.

Дополнительно в локальных GPO вы можете настроить лимиты (таймауты) на длительность RDP сессий и правила отключения пользователей при неактивности.

Если вы хотите настроить различные групповые политики для локальных пользователей и администраторов, воспользуйтесь функционалом множественных GPO (MLGPO).

Теперь нужно создать для пользователей локальные учетные записи на RDS сервере, под которыми они будут аутентифицироваться. Можно создать пользователей с помощью оснастки lusrmgr.msc или через PowerShell:

$UserPassword = ConvertTo-SecureString "Pa$$dr0w!!" -AsPlainText -Force
New-LocalUser "AIvanov" -Password $UserPassword -FullName "Andrey Ivanov"

Чтобы разрешить пользователю подключаться к серверу через службы Remote Desktop Services, нужно добавить аккаунт в локальную группу Remote Desktop Users. Добавьте пользователей вручную через консоль управления группами или через PowerShell:

Add-LocalGroupMember -Group "Remote Desktop Users" -Member AIvanov

локальная группа Remote Desktop Users

Для данной группы пользователей разрешен вход в локальной политикие Allow logon through Remote Desktop Services (Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment). Эта же политика позволяет обеспечить RDP вход пользователям даже на контроллер домена.

Теперь пользователи могут попробовать со своих компьютеров подключится к вашему RDS хосту с помощью клиента mstsc.exe (или любого другого RDS клиента). Проверьте, что к серверу одновременно может подключится более двух активных RDP сессий .

При первом входе устройству пользователя выдается временная лицензия (особенности RDS Per Device лицензирования). При втором входе выдается постоянная лицензия, которая появится в консоли Remote Desktop Licensing Manager. Лицензия выдается на срок от 52 до 89 дней (случайное число).

Если у вас исчерпаны Per Device лицензии, вы можете вручную отозвать лицензии для некоторых устройств пользователей. Воспользуйтесь консоль RDSLicensing или таким PowerShell скриптом:

$licensepacks = Get-WmiObject win32_tslicensekeypack | where {($_.keypacktype -ne 0) -and ($_.keypacktype -ne 4) -and ($_.keypacktype -ne 6)}
# общее количество лицензий типа per device
$licensepacks.TotalLicenses
# количество лицензий, выданных устройствам
$TSLicensesAssigned = gwmi win32_tsissuedlicense | where {$_.licensestatus -eq 2}
# имя компьютера, для которого нужно отозвать лицензию
$compname="MSK-PC16"
$RevokePC = $TSLicensesAssigned | ? sIssuedToComputer -EQ $compname
$RevokePC.Revoke()

Если вам нужно подключиться в RDP сессию пользователя, вы можете воспользоваться режимом теневого подключения RDS (он работает на RDSH в рабочей группе).

A step by step guide to build a Windows Server 2019 Remote Desktop Services deployment.
I posted this before based on Windows Server 2012 R2 RDS and thought it was high time to update this post to a more modern OS version.
I will provide all the steps necessary for deploying a single server solution using the GUI tools.

Although it is called a single server installation, we will need 2 servers as shown below.

01 RDS Deployment - Single Server 2019

Software used in this guide:
Windows Server 2019 ISO (evaluation can be downloaded here: https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2019).

SQL Server 2017 Express x64 (free version can be downloaded here: https://www.microsoft.com/en-us/download/details.aspx?id=55994).

SQL Server 2016 Native Client (free version can be downloaded here: https://www.microsoft.com/en-us/download/details.aspx?id=52676. After clicking the download button select ENUx64sqlncli.msi). Although I’m installing SQL Express 2017, there are no newer client tools available.

SQL Server Management Studio (free, and can be downloaded here: https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms).

And a certificate. I got mine for free from https://www.sslforfree.com/. This certificate needs to contain the FQDN you will use as the RD Web Access URL (mine is rds.it-worxx.nl in this guide). It needs to be in .pfx format and you need to have the private key in it.

This guide will not focus on building a domain using a single domain controller and adding the second server as a member server to this domain.

Also some basic knowledge is assumed in this guide. I will not detail how to create a Security Group and adding a computer account to it. I will also not detail how to install SQL Express, or adding logins to a SQL Server Instance security context. If you need extra help with this, Bing it or drop me a mail with details, and I will provide steps to continue.

I will be using Hyper-V on my Windows 10 1809 laptop and I have prepared 2 servers:

ITWDC (1 vCPU, 1024MB memory, dynamic, 60GB Harddisk)
Installed Windows
IPv4 192.168.0.4/24
Added .NET Framework 3.5 as a feature

Added Active Directory Domain Services as a role

Configured this server as a Domain Controller in a new forest: it-worxx.lab

ITWRDS (1 vCPU, 1024MB memory, dynamic, 60GB Harddisk)

Installed Windows

Added .NET Framework 3.5 as a feature

IPv4 192.168.0.10/24, DNS server 192.168.0.4

Configured it as a member server in the it-worxx.lab domain

Installing the Remote Desktop Services Roles

Log on to the Domain Controller, and in Server Manager right-click the All Servers node and add the second server using the Add Servers command (or select the All Servers node, click Manage and click Add Servers).

02 RDS Deployment - Single Server 2019

Now that all servers needed in this deployment scenario are present, click Manage, and click Add Roles & Features.

Before you begin
03 RDS Deployment - Single Server 2019
Click Next.

Select Installation Type
04 RDS Deployment - Single Server 2019
Select Remote Desktop Services installation.
Click Next.

Select Deployment Type
05 RDS Deployment - Single Server 2019
Although Quick Start might be a valid option for a single server deployment, leave the default selected. This will explain the steps necessary to install Remote Desktop Services in greater detail.
Click Next.

Select Deployment Scenario
06 RDS Deployment - Single Server 2019
Select Session-based desktop deployment.
Click Next.

Review Role Services
07 RDS Deployment - Single Server 2019
Review the services that will be installed.
Click Next.

Specify RD Connection Broker server
08 RDS Deployment - Single Server 2019
Click the member server and click the Add button.
Click Next.

Specify RD Web Access server
09 RDS Deployment - Single Server 2019
Check Install the RD Web Access role on the RD Connection Broker server.
Click Next.

Specify RD Session Host server
10 RDS Deployment - Single Server 2019
Click the member server and click the Add button.
Click Next.

Confirm selections
11 RDS Deployment - Single Server 2019
Check Restart the destination server automatically if required.
Click Deploy.

View progress
12 RDS Deployment - Single Server 2019
Wait until all role services are deployed and the member server has restarted.
Click Close.

In Server Manager click Remote Desktop Services and scroll down to the overview.
13 RDS Deployment - Single Server 2019
As you can see the deployment is missing a RD Gateway server and a RD Licensing server.

14 RDS Deployment - Single Server 2019
Click the Add RD Licensing server button.

Select a server
15 RDS Deployment - Single Server 2019
Click the domain controller and click the Add button.
Click Next.

Confirm selections
16 RDS Deployment - Single Server 2019
Click Add.

View progress
17 RDS Deployment - Single Server 2019
Wait until the role service is deployed. No restart is needed.
Click Close.

18 RDS Deployment - Single Server 2019
Click the Add RD Gateway server button.

Select a server
19 RDS Deployment - Single Server 2019
Click the member server and click the Add button.
Click Next.

Name the self-signed SSL certificate
20 RDS Deployment - Single Server 2019
The wizard creates a self-signed certificate. We will deal with certificates in this deployment in a little bit. We will replace the self-signed certificate.

Enter the external Fully Qualified Domain Name which you will also use for the Web Access URL. In my case, for lack of a better name, I used “rds.it-worxx.nl”. I didn’t want to use “remote.it-worxx.nl” or “desktop.it-worxx.nl” or anything else.
Click Next.

Confirm selections
21 RDS Deployment - Single Server 2019
Click Add.

View progress
22 RDS Deployment - Single Server 2019
Wait until the role service is deployed. Again, no restart is needed.

Notice that “rds.it-worxx.nl” was configured for the deployment.

Also notice that even more certificate configuring is needed, but we’ll get to that later. Pay no attention to it for now. The same goes for the RD Gateway properties for the deployment. We’ll get to that later.
Click Close.

Review role installation and setting License Mode

Let’s have a quick look at the configuration we have so far.

23 RDS Deployment - Single Server 2019
In Server Manager, Remote Desktop Services, Overview, click Tasks and click Edit Deployment Properties.

Configure the deployment
24 RDS Deployment - Single Server 2019
Review the RD Gateway settings and notice what settings are available.
Click RD Licensing.

Configure the deployment
25 RDS Deployment - Single Server 2019
Notice that an RD License server is available, but no license type is selected yet.

I selected Per User, but since this is just a guide setup, it really doesn’t matter.
Click RD Web Access.

Configure the deployment
26 RDS Deployment - Single Server 2019
By default the RD Web Access IIS application is installed in /RdWeb.

If you want to know how to change this, check another post: https://msfreaks.wordpress.com/2013/12/07/redirect-to-the-remote-web-access-pages-rdweb/

This is for Windows Server 2012 R2 RDS, but it also works for Windows Server 2019 RDS.
Click Certificates.

Configure the deployment
27 RDS Deployment - Single Server 2019
Notice that the certificate level currently has a status of Not Configured.
As you can see, certificates are used for different goals within the deployment.

The RD Gateway certificate is used for Client to gateway communication and needs to be trusted by the clients. Either install the self-signed certificate on all clients, or use a certificate for which the complete certificate chain is already trusted by all clients. As it said in the wizard, the external FQDN should be on the certificate.

The RD Web Access certificate is used by IIS to provide a server identity to the browser clients.

The RD Connection Broker actually has two goals for which it needs certificates. To enable single sign on (server to server authentication), and for publishing (signing RDP files). If you look in the deployment you’ll see that the Connection Broker is now configured to use “itwrds.it-worxx.lab”, so we have to change it to use an external FQDN as well.

If we use the same FQDN for all goals described above, we need only 1 certificate, and only 1 external IP address.

We’ll come back to this wizard later to assign the certificate. First order of business is to change the internal FQDN for the Connection Broker to an external FQDN.

Click OK (no reason why we shouldn’t commit the change we made on the licensing tab, remember?)

Changing the Connection Broker FQDN to an externally resolvable FQDN

Open DNS Manager on the domain controller and browse to Forward Lookup Zones.
28 RDS Deployment - Single Server 2019
Right click Forward Lookup Zones and click New Zone… Go through this wizard accepting the defaults until you have to enter a Zone Name.

29 RDS Deployment - Single Server 2019
Enter the external FQDN which will also be used by the Connection Broker.

Finish the rest of the wizard accepting the defaults.

Browse to the newly created zone.
30 RDS Deployment - Single Server 2019
Right click the newly created zone and click New Host (A or AAAA)…

New Host
31 RDS Deployment - Single Server 2019
Leave the Name field blank, but enter the member server’s (holding the RD Connection Broker role) IPv4 address.
Click Add Host.

Now the configuration will be able to resolve “rds.it-worxx.nl” to the server holding the Connection Broker role, and this will work because “rds.it-worxx.nl” is also on the certificate that we will configure later.

Create a new Global Security Group called “RD Connection Brokers” and add the computer account for the member server to it as a group member.

We need this group to be able to convert the RD Connection Broker to a highly available RD Connection Broker. You’ll see why we need to do this in a few steps.

Reboot the member server to let it know it’s a member of the RDS Connection Brokers security group.

The next steps in re-configuring the RD Connection Broker depend on an SQL database shared by all Connection Brokers in the deployment. Without this configuration the RD Connection Broker will rely on the Windows Internal Database that was created during the initial deployment of the roles.

Install SQL Express on the Domain Controller (or use an existing SQL Server if you already have one).

It’s not best practice to install SQL onto a Domain Controller, but it’ll do for this guide.

Here’s a list of needed features:
32 RDS Deployment - Single Server 2019

33 RDS Deployment - Single Server 2019
Use the Default Instance (so click Default, and do not leave the wizard’s selection on Named instance: SQLEXPRESS).

34 RDS Deployment - Single Server 2019
Set the SQL Service to start using SYSTEM because the default account of SQLSERVER cannot be used on a Domain Controller.

When the installation is done open SQL Configuration manager and browse to Client Protocols under SQL Native Client 11.0 Configuration.
35 RDS Deployment - Single Server 2019
Check if TCP/IP is enabled under Client Protocols. SQL Express install enables this by default, but check it just to be sure, especially if you use an existing SQL Server.

Browse to Protocols for MSSQLSERVER under SQL Server Network Configuration.
36 RDS Deployment - Single Server 2019
Enable TCP/IP. If this is a new SQL installation, this will be disabled by default.
Restart the SQL Server service if you changed this setting.

On the SQL Server, make sure port 1433 is not being blocked by Windows Firewall.
37 RDS Deployment - Single Server 2019
I added the SQL Server executable to the exception list to allow all inbound traffic, but TCP 1433 inbound should suffice.
If you installed SQL Server using the default folder locations, the sqlservr.exe executable is found in “C:Program FilesMicrosoft SQL ServerMSSQL14.MSSQLSERVERMSSQLBinn”.

Open SQL Server Management Studio, connect to the default instance on the Domain Controller and browse to Logins under Security.
38 RDS Deployment - Single Server 2019
Remember the Management Studio is no longer available with the SQL Server download, but is a different download.
Right click Logins and click New Login…

Login – New
39 RDS Deployment - Single Server 2019
Click Search…

Select User, Service Account, or Group
40 RDS Deployment - Single Server 2019
Click Object Types… and select Group.
Type the RDS Connection Brokers security group name and click Check Names.
Click OK.

Login – New
41 RDS Deployment - Single Server 2019
Click Server Roles and select dbcreator.
Click OK.

We have just effectively granted the RDS Connection Broker server the right to create databases.

We need this because the RDS Connection Broker service will try to migrate from WID (Windows Internal Database to a (high available) SQL Server instance when we convert the Broker to a high available broker.

Install the SQL Native Client on the member server (Client Components only). If you used the member server in this setup to install the SQL Management Studio, you can skip this step because the Native Client was installed with installing the Management Studio.

Everything we need is in place to convert the RD Connection Broker, so let’s do just that.

In Server Manager click Remote Desktop Services and scroll down to the overview.
42 RDS Deployment - Single Server 2019
Right click RD Connection Broker and click Configure High Availability.

Before you begin
43 RDS Deployment - Single Server 2019
So we’re building a single node cluster here ;)
Look at the pre-requisites.

If you have more than one RD Connection Broker they need to be configured using DNS Round Robin.

Click Next.

Configure RD Connection Broker for High Availability
44 RDS Deployment - Single Server 2019
Since we just installed an SQL Server for this, leave the default selected. You’d use the other option for instance if you’d like to use Azure SQL for this deployment.
Click Next.

Configure RD Connection Broker for High Availability
45 RDS Deployment - Single Server 2019
DNS name for the RD Connection Broker cluster:
The DNS Zone name we configured in DNS earlier: rds.it-worxx.nl

Connection string:
DRIVER=SQL Server Native Client 11.0;SERVER=ITWDC;Trusted_Connection=Yes;APP=Remote Desktop Services Connection Broker;DATABASE=ITWRDCB

Folder to store database files:
C:Program FilesMicrosoft SQL ServerMSSQL14.MSSQLSERVERMSSQLDATA
I used the instance default folder.

Click Next.

Confirmation
46 RDS Deployment - Single Server 2019
If you get an error before this page:

  • Check if TCP/IP is enabled in client protocols and for your instance
  • Check if you can reach port 1433 on the SQL Server from the member server

Click Configure.

Progress
47 RDS Deployment - Single Server 2019
If you get an error on this page:

  • Check SQL permissions for the security group
  • Check if the database path you entered is correct

Click Close.

48 RDS Deployment - Single Server 2019
The RD Connection Broker is now in High Availability Mode, and configured as “rds.it-worxx.nl” and we are finally ready to complete the configuration.

Configuring Certificates

49 RDS Deployment - Single Server 2019
In Server Manager, Remote Desktop Services, Overview, click Tasks and click Edit Deployment Properties, then click Certificates.

Configure the deployment
50 RDS Deployment - Single Server 2019
Click RD Connection Broker – Enable Single Sign On and click Select Existing certificate.

51 RDS Deployment - Single Server 2019
Browse to the .pfx file, enter its password, and check Allow the certificate..
Click OK.

67 RDS Deployment - Single Server 2019
So click Apply. This takes a little while, be patient.

Configure the deployment
52 RDS Deployment - Single Server 2019
Click RD Connection Broker – Publishing and click Select Existing certificate.

51 RDS Deployment - Single Server 2019
Browse to the .pfx file, enter its password, and check Allow the certificate..
Click OK.

67 RDS Deployment - Single Server 2019
Click Apply. This again takes a little while, be a little more patient.

Configure the deployment
53 RDS Deployment - Single Server 2019
Click RD Web Access and click Select Existing certificate.

68 RDS Deployment - Single Server 2019
Note: Did you notice the warning when you select RD Web Access?

51 RDS Deployment - Single Server 2019
Browse to the .pfx file, enter its password, and check Allow the certificate..
Click OK.

67 RDS Deployment - Single Server 2019
Click Apply again. This takes another little while longer, be slightly more patient.

Configure the deployment
54 RDS Deployment - Single Server 2019
Last one. Click RD Gateway and click Select Existing certificate.

51 RDS Deployment - Single Server 2019
Browse to the .pfx file, enter its password, and check Allow the certificate..
Click OK.

Click OK to apply the final certificate step.

Configured all servers, configured certificates..

One thing left to do: Tell our RDS environment exactly what to publish.

Publishing resources to your users

In fact you can use this setup to either provide full desktop sessions on the Session Host, or you can choose to publish only applications on the Session Host.

Let’s publish full desktop sessions.

55 RDS Deployment - Single Server 2019
In Server Manager, Remote Desktop Services, Session Collections, click Tasks and click Create Session Collection.

Before you begin
56 RDS Deployment - Single Server 2019
Review the requirements. This won’t be an issue in this setup, but you could restrict access to this collection by selecting a select group of people.
Click Next.

Name the collection
57 RDS Deployment - Single Server 2019
Enter a descriptive name. This name will be displayed under its icon in the Web Access interface.
Click Next.

Specify RD Session Host servers
58 RDS Deployment - Single Server 2019
Click the member server and click the Add button.
Click Next.

Specify user groups
59 RDS Deployment - Single Server 2019
You can limit access to the resource here if you want. Add one or more groups to restrict access to these groups only. In this setup the default selection of Domain Users will do fine. Groups you specify here will be added to the list of groups of users that are allowed to connect using RDP to the Session Host server(s).
Click Next.

Specify user profile disks
60 RDS Deployment - Single Server 2019
User profile disks are not in focus in this guide. Since I have no file shares configured in this setup, uncheck Enable user profile disks for now.
Click Next.

Confirm selections
61 RDS Deployment - Single Server 2019
Review the information and click Create.

View Progress
62 RDS Deployment - Single Server 2019
Wait until the collection is created and the server is added to the collection.
Click Close.

Time to test the setup!

Testing the setup

On a machine that has access to your test setup (you may have to add the external FQDN to your hosts file if you didn’t publish it to the internet) open https://rds.it-worxx.nl/rdweb

63 RDS Deployment - Single Server 2019
Hey! At least the RD Web Access application works :)
Enter a valid username and password (IT-WORXXusername or username@it-worxx.lab).
Create a user for this, or simply use the domain admin account.
Click Sign in.

64 RDS Deployment - Single Server 2019
After logging in you are presented with the full desktop session collection we created.

65 RDS Deployment - Single Server 2019
After clicking the Full Desktop icon you get the warning that devices are going to be redirected.

66 RDS Deployment - Single Server 2019
And when you click Connect, you connect :)

Enjoy.

Arjan

In this post I will go step by step to include everything you need to do to build an RDS farm that will include x2 RDS Broker Server, x2 RDS Session Hosts and x1 SQL Server.  I will go over how to achieve HA for the entire environment and what you will need to do to get everything up and running.

Design Overview

For this deployment I want to use the below:

2x RDS Broker Server

2x RDS Session Hosts

Users are to connect to the RDS Broker Servers as below and then redirected to the RDS Session Hosts.  From there they can then connect to other target servers.

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-Design

As the clients will be connecting to the RDS Broker Servers we need to add DNS Round Robin for the RDS Broker Servers in DNS.  For example we have rdsbroker1.domain.com with IP 10.10.20.10 and rdsbroker2.domain.com with IP 10.10.20.11.  We would add a new DNS name for the RDS Broker Cluster of:

rdsbrokercluster.domain.com IP 10.10.20.10

rdsbrokercluster.domain.com IP 10.10.20.11

In Microsoft DNS please ensure DNS Round Robin is also enabled.

Installing the RDS Server Roles

First do a basic installation of Windows Server 2019 Standard on x5 servers.  Once your servers are ready all we need to add all of the servers into one single console for the RDS deployment.

Open the Server Manager and click 3. Add other servers to manage

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-1

Add in all the soon to be broker and session host servers and click ok

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-2

Click 4. Create a server group, give it a name and add the soon to be RDS servers to it and click ok

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-3

Here is the group, click on it

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-4

You will see all the RDS servers available

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-5

The deployment of an RDS infrastructure is facilitated by the tool built into the server managers, in a single command the following roles will be installed:
• Remote Desktop Session Host
• Broker
• Remote Desktop Access via the Web

From server manager click add roles and features

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-6

Click next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-7

Select Remote Desktop Services installation and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-8

Select a standard deployment and click next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-9

Select session-based deployment and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-10

Click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-11

Add the first broker server and click Next (we will add the second in later when we configure HA)

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-12

Select install the RD Web Access role on the RD connection broker

Select the session host and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-13

Add the RD Session host servers and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-14

Confirm is all ok and select Restart if required, click Deploy

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-15

Roles are deployed

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-16

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-17

Create a collection to specify the hosts and who can access them
Open server manager and click Remote Desktop Services, click collections and click Create Session Collection

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-18

Click next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-19

Name the collection

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-20

Select your session host servers and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-21

Add the groups that are allowed to login to the host servers

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-22

Enter path of user profile disk folder (the NTFS and share permissions must allow full control for the RDS server AD objects – we will come back to this later)

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-23

Confirm all is correct and click create

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-24

Configurations are applied

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-25

Select the collection and click Tasks, Edit properties

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-26

Edit the session properties so that sessions can expire

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-27

Select the security options

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-28

Select any server weighting

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-29

Configure client settings and click ok

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-30

Open RDS Licensing

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-31

Add the license servers (I used the session hosts)

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-32

Click Add

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-33

Licensing configuration is applied

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-34

Right click on RD Licensing and click select RD licensing mode

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-35

Select the license mode and click Apply> Ok

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-36

From the session host where we install the license server role click Tools> Remote Desktop Services> Remote Desktop Licensing Manager

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-37

Right click and Activate server

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-38

Select Automatic Connection

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-39

Enter company details

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-40

Enter email

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-41

Click Next to add licenses

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-42

Select Enterprise Agreement

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-43

Enter agreement number

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-44

Enter license details and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-45

License is installed

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-46

Go to License server and open RDS License Console.  Right click license server and click Review configuration

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-47

Click add to group

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-48

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-49

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-50

Repeat on any additional license servers (I split 50:50 between my session hosts)

Preparing for the RDS Broker HA Configuration

First we need to create the user profile disk folder on a server and share.  This needs to be highly available so I store mine on a replicated DFS folder.  On a file server create a folder for RDS profiles and share. The RDS session hosts need full control.

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-51

Do the same for NTFS permissions

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-52

Create AD security group and add broker servers

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-53

For the purpose of this guide and because we do not want to focus on SQL too much we will just use a standalone SQL Express database.  However for highly available setups the best solution is to use Always On Availability Groups as in my guide here.

Next Setup new 2019 server and install SQL Express, I used SQL Server Express 2019 (latest available).   Install SQL Management Studio and login. Then add a new login for RDS servers

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-54

Click search

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-55

Select the RDS Server Broker group

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-56

Select dbcreator in roles

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-57

Login is added to the list

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-58

Click New Database

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-59

Name the database

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-60

Database is added

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-61

Modify the login you created to make it db owner

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-62

On the RDS servers install the SQL client from the install media

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-63

Next on your SQL servers add the broker server accounts to the Remote Management Users group

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-95

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-96

Configure RDS Broker Servers for HA

Go to RDP Overview and right click the connection broker, then click Configure High Availability

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-64

Click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-65

Select dedicated database server

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-66

Enter RDS broker cluster name and input connection string and click next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-67

The connection string I used for this setup is:

DRIVER=SQL Server Native Client 11.0;SERVER=VMMGTRDSSQL101;Trusted_Connection=Yes;APP=Remote Desktop Services Connection Broker;DATABASE=RDSHA

If you are using multiple subnets and SQL Availability Groups, your string should look more like the below – using the DNS name of your SQL listener

DRIVER=SQL Server Native Client 11.0;SERVER=aglinuxrds;MultiSubnetFailover=True;Trusted_Connection=Yes;APP=Remote Desktop Services Connection Broker;DATABASE=RDSHA

If this doesn’t work try this, MultiSubnetFailover=Yes changes from True at one of the client versions

DRIVER=SQL Server Native Client 11.0;SERVER=aglinuxrds;Trusted_Connection=Yes;MultiSubnetFailover=Yes;APP=Remote Desktop Services Connection Broker;DATABASE=RDSHA;

If you have any problems at this stage first check your SQL server is listening on port 1433

Powershell (from the SQL server)

If not, open SQL configuration manager and click SQL Server Network Configuration>Protocols>TCP/IP and ensure the right IPs are enable and port 1433 is added as below

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-68

Click Configure

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-69

The task is executed, click close

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-70

Adding a broker server

From the deployment overview Right click on the RD Connection Broker click add RD Connection Broker Server

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-71

Click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-72

Add the second RDS Broker server and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-73

Click Add

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-74

The wizard should complete

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-75

If you have any issues at this stage connecting to the database check the SQL server log

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-76

I was seeing this

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-77

Check that the logins are still applied as db_owner – for some reason mine had dropped out even though it was definitely set and worked for the first server

Here is a PowerShell script you can use to test your SQL connection (Should just return True or False)

function Test-SQLConnection
{    
    [OutputType([bool])]
    Param
    (
        [Parameter(Mandatory=$true,
                    ValueFromPipelineByPropertyName=$true,
                    Position=0)]
        $ConnectionString
    )
    try
    {
        $sqlConnection = New-Object System.Data.SqlClient.SqlConnection $ConnectionString;
        $sqlConnection.Open();
        $sqlConnection.Close();

        return $true;
    }
    catch
    {
        return $false;
    }
}


 
Test-SQLConnection "DRIVER=SQL Server Native Client 11.0;SERVER=VMMGTRDSSQL101;Trusted_Connection=Yes;APP=Remote Desktop Services Connection Broker;DATABASE=RDSHA" 

Create a certificate to secure the connection to the RDS Broker server

Open IIS on the RDS Broker server and go to Server Certificates

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-79

Click Create New Certificate Request> Make bit length 2048

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-80

Save the request file

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-81

Click Finish

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-82

Go to the certificate authority server and issue the certificate using the request file from the RDS Broker.  Simply open the command line and enter the following:

certreq -submit -attrib "CertificateTemplate:WebServer" wintelbastionreq.txt

Save the certificate output as a .cer file and copy it back onto the RDS Broker.

Go to IIS again and Server Certificates, then click complete certificate request.  Select the .cer file you just collected from the CA and select the Personal Store.

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-83

Open the certificate console by going to Start>Run certlm.msc

You will see the certificate installed in the personal computer store

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-84

Right click on the certificate and click Export

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-85

Select .PFX and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-86

Specify a password and select SHA256

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-88

Save the .pfx file

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-89

Go back to the RDS Deployment Overview> Select Tasks> Properties> Certificates. Click Select existing certificate and enter the path to the .pfx file you just saved and enter the password you specified

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-90

The certificate is deployed to both RDS Broker servers and now used to secure the connection

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-91

Connecting clients to RDS Broker

I just wanted to use a normal RDP connection for clients to connect to the brokers and then be redirected to the session hosts.  To do this first you need to check the below registry entry:

Check registry entry for your collection (may differ to actual collection name).  Mine was as below:

HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionTerminal ServerCentralPublishedResourcesPublishedFarmsDomain_-_Wintel_Bas

Copy collection name from registry.

Create an .rdp file open in Notepad and add these lines to it:

use redirection server name:i:1
loadbalanceinfo:s:tsv://MS Terminal Services Plugin.1.Domain_-_Wintel_Bas
full address:s:WINTELBASTION.DOMAIN.COM

Brokers should now redirect to Sessions hosts

Установим роли терминального сервера на Windows Server 2019 и лицензируем. Маленькая тонкость — сервер не в домене.

Подготовка Windows Server 2019

Для начала установим сам сервер. Всё необходимое вынесено в отдельную статью:

Установка Windows Server 2019 на виртуальную машину VMware

Не забываем про настройку:

Первоначальная настройка Windows Server 2019

Итак, операционная система установлена и настроена. Сервер в рабочей группе WORKGROUP.

win

Установка роли терминального сервера

Нам понадобится установить две роли, можно выполнить установку одновременно, я предлагаю инструкцию с минимальным количеством перезагрузок.

Роль Remote Desktop Licensing

Входим в Server Manager. Справа вверху выбираем Manage > Add Roles and Features.

win

Попадаем в раздел Before You Begin.

win

Это начальная страница, пропускаем. Next.

win

Попадаем в раздел Installation Type. Для установки сервиса удаленных рабочих столов предусмотрен специальный мастер Remote Desktop Services installation, но нам не удастся его использовать, поскольку сервер не в домене. Выбираем Role-based or feature-based installation. Next.

win

Попадаем в раздел Server Selection. Выбираем текущий сервер. Next.

win

Попадаем в раздел Server Roles. Выделяем галкой роль Remote Desktop Services. Next.

win

Попадаем в раздел Features. Здесь ничего дополнительно не выбираем. Next.

win

Попадаем в раздел Remote Desktop Services. Ненужное нам окошко. Next.

win

Попадаем в раздел Role Services. Первая роль, которую нам нужно установить, это Remote Desktop Licensing. Выделяем галкой.

win

Нам предлагают установить дополнительные фичи, которые требуются для данной роли. Соглашаемся, Add Features.

win

Remote Desktop Licensing выделено галкой, Next.

win

Попадаем в раздел Confirmation. Install.

win

Начинается установка роли.

win

Роль Remote Desktop Licensing успешно установлена. Примечательно, что перезагрузка не требуется.

win

Открываем Windows Administrative Tools.

win

Переходим в папку Remote Desktop Services.

win

Запускаем оснастку Remote Desktop Licensing Manager.

win

Выбираем наш сервер, правой кнопкой — активировать.

win

Открывается окно активации. Next.

win

Выбираем метод соединения Web Browser. Next.

win

Получаем код продукта который нам понадобится для активации (Product ID). Копируем.

В браузере открываем сайт https://activate.microsoft.com/

win

Выбираем «Activate a license server». Next.

win

Вводим Product ID полученный ранее, организацию и любую страну или регион. Next. Next.

win

Если все сделано правильно, то мы получим необходимый код сервера лицензирования. Копируем его. На вопрос «Do you wish to install client access licenses now on the license server with this product ID?» отвечаем «Yes» и пока возвращаемся к терминальному серверу, к текущему окну ещё вернёмся.

win

Вводим код в открытом мастере, жмём Next.

win

Устанавливаем галку «Start Install Licenses Wizard now». Next.

win

Открывается мастер установки лицензий. Next.

win

Нас просят ввести license key pack ID. Возвращаемся к браузеру.

win

Вставляем License Server ID, в качестве программы лицензирования, по идее он уже должен сюда переместиться из предыдущего окна. License Program выбираем Enterprise agreement. Указываем компанию и страну. Next.

win

Выбираем тип продукта: Windows Server 2019 Remote Desktop Services Per Device client access license. Указываем количество лицензий. Обязательно соглашение Enterprise agreement, или ищем в интернете который подойдет…

Настройка и лицензирование терминального сервера Windows Server 2016

Не стоит выбирать лицензии Per User, иначе потом вы получите такую ошибку:

win

Next.

win

Ну вот мы и получили нужные нам клиентские лицензии. Копируем.

win

Вводим ключ в мастер. Next.

win

Finish.

win

Возвращаемся к Remote Desktop Licensing Manager. Сервер активирован. Лицензии получены. Кстати, они начнут тратиться после окончания триального периода.

Роль Remote Desktop Session Host

Входим в Server Manager. Справа вверху выбираем Manage > Add Roles and Features.

win

Попадаем в раздел Before You Begin.

win

Это начальная страница, пропускаем. Next.

win

Попадаем в раздел Installation Type. Выбираем Role-based or feature-based installation. Next.

win

Попадаем в раздел Server Selection. Выбираем текущий сервер. Next.

win

Попадаем в раздел Server Roles. Выделяем галкой роль Remote Desktop Session Host.

win

Нам предлагают установить дополнительные фичи, соглашаемся. Add Features.

win

Роль Remote Desktop Session Host выделена. Next.

win

Попадаем в раздел Features, ничего не выделяем. Next.

win

Попадаем в раздел Confirmation. Ставим галку Restart the destination server automatically if required. Отображается предупреждение, что сервер может быть перезагружен. Yes.

win

Install.

win

Начинается процесс установки роли.

win

Сервер перезагружается.

win

В процессе устанавливаются компоненты.

win

После перезагрузки автоматически продолжается установка роли. Триальный период работы терминального сервера — 119 дней.

win

Роль Remote Desktop Session Host успешно установлена. Close.

win

Открываем Windows Administrative Tools.

win

Переходим в папку Remote Desktop Services.

win

Запускаем оснастку Remote Desktop Licensing Diagnoser.

win

Видим ошибку.

The licensing mode for Remote Desktop Session Host server is not configured.

Выполняем gpedit.msc.

gpedit.msc

win

Откроется Local Group Policy Editor.

win

Раскрываем Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Licensing.

win

Редактируем Use the specified Remote Desktop license servers.

win

Включаем — Enabled. В поле «License server to use» прописываем сервер, с которого получать лицензии, в моём случае «localhost». OK.

win

Редактируем Set the Remote Desktop licensing mode.

win

Включаем — Enabled. В поле «Specify the licensing mode for the RD Session Host server» устанавливаем значение Per Device. OK.

win

Снова запускаем оснастку Remote Desktop Licensing Diagnoser. Теперь всё зелёное, ошибок нет.

Практические испытания

Поскольку мы с вами системные администраторы 99 уровня, то нам нужно провести практические испытания терминального сервера.

win

На терминальном сервере создаём трёх локальных пользователей: user1, user2, user3.

win

Включаем их в группу Remote Desktop Users.

win

Коннектимся под этими пользователями к терминальному серверу по RDP.

win

Есть три активных сеанса.

Заключение

Мы с вами успешно создали терминальный сервер Windows Server 2019 в рабочей группе WORKGROUP без домена. 120 дней терминальный сервер будет работать в триальном режиме, затем начнёт использовать лицензии Per Device. Для подключения к терминальному серверу требуется создать локальную учётную запись и включить её в группу Remote Desktop Users.

Contents

In this tutorial, we will see how to set up a RDS farm in Windows 2012R2 / 2016/2019 with the following features:

  • Remote Desktop Session Host (x2)
  • Service broker for the distribution of connections
  • Setting up a collection
  • Publishing RemoteApp on a web portal
  • Remote Desktop Gateway
  • User Profile Disk (UPD)

To set up a complete rds farm, you need a minimum of 4 servers, not including the domain controller and file and print server. All farm servers must be members of the same Active Directory domain.

Composition :

Name IP Roles
LAB-RDS1.rdr-it.intra 172.16.0.184 Remote Desktop Session Host
LAB-RDS2.rdr-it.intra 172.16.0.185 Remote Desktop Session Host
LAB-RDS-BRK.rdr-it.intra 172.16.0.186 Service Broker / License Manager
LAB-RDS-GW-WEB.rdr-it.intra 172.16.0.187 Gateway Remote Desktop / Web Access  
RDS Farm

For the realization of the tutorial, I used an AD server, LAB-AD1.rdr.it.intra with the IP address 172.16.0.100. DC is used for storing UPDs.

Server role definitions that are part of an RDS farm.

Remote Desktop Session Host : On these servers, the user sessions are open and allow them to work.

Service broker : This is the circulation agent for sessions in an environment with multiple remote desktop session hosts.

Remote Desktop Gateway : Its primary role is to enable secure access to the RDS infrastructure from the Internet. It connects to the farm using HTTPS and filters connections using access policy.

Web Access : publishes a web portal that allows access to applications via RemoteApp via an Internet browser. This role is also used for RemoteApp access for Windows clients. Through this portal, it is also possible to put the password change of the users.

License Manager : This service is used for license distribution (CAL RDS).

The tutorial was made under Windows 2012R2. The deployment of an RDS farm under Windows 2016 and 2019 is almost identical.





Preface:

Remote Desktop Services is a robust role in the windows role group. RDS is used to remote into the central RDS server or any member server or the user’s desktop computer through the RDS server using the Remote Desktop web services either on the internal network or through the internet.

This article discusses the access of the servers and desktops accessed over the internet using RD Gateway using the https port. The Servers and desktops on the on-premises can be accessed without the need RDP port 3389 opened on the firewall. Where the RDP port 3389 is the hacking target for hackers over the internet. As the https port used for the access of remote desktop, the port is usually used for most of the businesses to access the webserver hosted internally.

The Remote Desktop Services will be cost-effective when the number of users or devices accessing applications with an excessive amount of licenses needed. Also, this role is most useful where the client computers installed on the company network or home is not the latest, and the application demands such as hardware or operating systems.

We are going to delve deep into this installation and configuration on an active directory domain network with network policy server (NPS) security. We are using a public CA certificate in this demonstration and hostname assigned on the public DNS.

The following points discussed in this article. Following this article, one can install and configure Remote Desktop Services on a Windows Server 2019 and publish the RDP app to access a server or a desktop as per need on the remote desktop web app portal.

  • Add Remote Desktop Services Role
  • Add Server to RD Licenses and RD gateway
  • Install public CA certificate to each role of RDS
  • Configure RD Licenses
  • Configure Remote App Collection
  • Publish and Configure Remote App
  • Access RD Web and Remote App

To begin with, the demonstration, let’s add the Remote desktop Roles group on the server manager and going forward to configure each component.

Add Remote Desktop Services Role

There are two Windows Server 2019 servers used on this demonstration where the first server is installed as a domain controller, and the RDS server has been joined to the domain of the domain controller, which we have added in the first place.

On the planned RDS installation server called remote, we are going to install the RDS role by launching the server manager dashboard and by clicking the “Add roles and features” link.

A screenshot of a cell phone

Description automatically generated

The instruction of wizard will show up on the screen, and if you don’t want to see this page on adding roles and features anymore, just check the skip this page checkbox and continue by clicking next.

The RDS Installation can be installed through Role-based or feature-based installation. Still, it requires a lot of effort as there are a number of components to be selected and configured after installation. To make life easier, Microsoft has consolidated all the component installation in one group. That installation method can be used by clicking the Remote Desktop Services installation option at the select installation type.

On the deployment type, select Quick Start so that all components will be installed by itself, and the Quick App Collection will be added to the Remote Desktop Services deployment. Select Quick Start and click Next.

In this article, we are going to look into Session-based desktop deployment, so select session-based desktop deployment and click Next.

On the Server Selection page, select the local server where we have planned for RDS deployment and click next.

On the confirmation page, check the checkbox “Restart the destination server automatically if required” and click deploy to start the RDS deployment.

When the Deploy tab is clicked, the RDS Role installation will start installing roles, and the progress can be monitored on the popup.

The server will be restarted in the middle of the installation. When the server restarted and logged in as the same administrator account, the installation will continue, and the progress will show succeeded on the RDS roles deployment completion.

Once the Remote Desktop Services role has been added, the very next step is to configure it. On the server manager, you would find a Remote Desktop Service deployment setup on the left side navigator. Click on that, and additional configuration of this service will be available.

Add Server to RD Licenses and RD gateway

The icons in green or not configured with a deployment server, here the RD licensing and RD Gateway, are in green, and we are going to configure them in the coming up steps. Click RD Licensing, and the configuration window will show up.

On the RD Licensing deployment windows select the server which in our case the local server and selects the server and click on the arrow next to it to deploy RD Licensing server and click Next.

Once the RD licensing server added, the result indicates succeeded next to the progress bar. Click close to close out the RD License server deployment wizard.

As we have already planned, this RDS server is accessed through the internet also, so our very next move is the deploy RD Gateway. Click the RD Gateway icon on the deployment overview area, which is in green, which means it has not been deployed yet. The RD Gateway deployment wizard will open, and we can deploy it with adding the server.

A screenshot of a social media post

Description automatically generated

We are adding the local server as an RD Gateway server to the Remote Desktop Services by clicking the arrow in the middle of the selection, and once the server added, click next to configure SSL certificate name.

A screenshot of a social media post

Description automatically generated

In this demonstration, I have already created a hostname under my public domain mrigotechno.club called remote, but you need to give a name that is relevant to your RDS gateway hostname and certificate pertinent to be purchased and installed on the internet information Server (IIS). Once the Certificate Name typed, click Next.

A screenshot of a social media post

Description automatically generated

On the confirmation, click add to add RD Gateway server to the deployment. Click Add.

On the Results page, the progress indicator will show succeeded and click Configure Certificate to install the certificate.

A screenshot of a social media post

Description automatically generated

Install public CA certificate to each role of RDS

On each role services on the Manage Certificate, we need to configure the certificate, there are four roles, and we need to configure the certificate for them. I have installed the third-party CA certificate on Internet information server and export it as a pfx file format while exporting I have secured the certificate with a password. Please have your third party certificate in pfx format file and the password of the pfx file handy as we are going to apply the certificate from the topmost role and apply one by one till the fourth role.

Select the first role and select an existing certificate to apply the certificate dialogue window.

On the Choose a different Certificate, click browse and select the pfx certificate file and type the password of the certificate and check “Allow the certificate to be added to the trusted root certification authorities certificate store on the destination computer.” Click OK to go back to manage the certificate window.

A screenshot of a social media post

Description automatically generated

On the state of the certificate configuration for the role, you would see Ready to Apply on state column, click apply and wait to change for the level to Trusted and status to OK and the state to Success. 

A screenshot of a social media post

Description automatically generated

Do the same steps to apply the certificate to the next three roles, and you would see the State changes to Success as in the below screen capture. Click OK to complete the certificate Configure.

A screenshot of a social media post

Description automatically generated

Configure RD Licenses

The Next step is to Edit Deployment properties, on the deployment overview click tasks, and select edit deployment propertied to start the wizard.

A screenshot of a social media post

Description automatically generated

As we have already completed Certificate configuration, we have only edit that we need to do RD Licensing. On the RD Licensing under Configure the deployment, select the RDS Licensing mode as per your requirement in the example. I have chosen Per user, but choose the one which is relevant to your environment and click OK.

A screenshot of a social media post

Description automatically generated

Configure Remote App Collection

On the left side navigation on the Remote Desktop Services Setup, you would see Quick Session Collection, where the App publisher available to published App, which we would access through RD Web Access. On the Properties area, click properties and select edit properties.

A screenshot of a computer

Description automatically generated

We are going to edit only one option in these properties that we are going to add the User groups to associate to this collection. I have already created a security group called RDS_Users and added some test users to it. I’m adding that group here to associate with the collection., click OK and back to the main window.

A screenshot of a cell phone

Description automatically generated

Publish and Configure Remote App

In this demonstration we are going to see how to access a member server or a user desktop from the RD web access from the internet, without opening RDP port 3389, the same steps will apply to add a user’s desktop. But make sure the member server or user desktop is enabled Remote Desktop on the system property of the computer. So I got a server on the network that can be configured to access from RD Web, we are going to configure Remote Desktop App by publishing the RDP app to the Quick Collection Apps.

On the Remote App Programs area, click tasks on the screen below and click “Publish RemoteApp Programs.”

A screenshot of a computer screen

Description automatically generated

You will be presented with selecting the RemoteApp programs list and choose the App you want to publish. In this case, the Remote Desktop Connection. Select “Remote Desktop connection” and click Next.

A screenshot of a social media post

Description automatically generated

On the confirmation page, click publish.

Deploying Remote Desktop Services

On the completion page, you would see published status message click close to go back to the main window.

Deploying Remote Desktop Services

On the Remote Desktop Connection RemoteApp that we just published right-click and select edit properties to configure the properties of the App.

Deploying Remote Desktop Services

On the General page, type a name that is appropriate for the RDP Connection Computer. In this case, it a server called server1, so I type the name server1 on the name box.

Deploying Remote Desktop Services

The next page is parameters, on the parameters page, click “Always use the following command paraments” radio button and type the IP address of the server or desktop to which the RDP connection to be established. In this case the private IP4 address of server1 is 192.168.24.190. The correct parameter value is /v:192.168.24.190. Replace the IP address with the one of the servers or Desktop IP address on your network.

Deploying Remote Desktop Services

The next item is User Assignment, add the user account to which users need to find this Remote App program that has to be visible on the RD Web Access login. Click add and choose the relevant user or group.

Deploying Remote Desktop Services

On the next page, leave the file type association with default setting and click OK.

Deploying Remote Desktop Services

Access RD Web and Remote App

We have completed all RDS configuration and moving on to the RD Web portal to login to the portal and access the apps assigned to the use. The URL for the RD Web is https://remote.mrigotechno.club/rdweb

Replace the remote.migotechno.club with the one you have configured for your environment.

Type the username and password with the domainuser format and password of the user and click Sign In.

Deploying Remote Desktop Services

The portal will show the web resources, the Remote desktop connection app that we have configured with the name server1 is available for us to access from the RD Web access login. Click Server1 and follow the login screen.

Deploying Remote Desktop Services

Click connect on the notification popup.

Deploying Remote Desktop Services

On the security login dialogue, type the user name and password of the user and click OK.

Deploying Remote Desktop Services

The RDP connection is remote into the server1 computer, as shown below.

Deploying Remote Desktop Services

The RDP access is successful to the IP address 192.168.24.190, and this concludes our demonstration.

Deploying Remote Desktop Services

Conclusion

In this article, we have discussed and gone through the demonstration of deploying Remote Access Services on Windows Server 2019 elaborately. You can follow the same step and deploy Remote Desktop Services on your lab or production environment.

I have demonstrated other roles of Windows Server 2019 in Get An Admin article. You may have some questions or feedback to share with me, please click the comments below and share your thoughts. I am so happy to answer your questions.

Понравилась статья? Поделить с друзьями:
  • Разблокировка экрана windows 10 горячие клавиши
  • Разблокировка файлов для удаления windows 10
  • Разблокировка учетной записи администратора windows 10
  • Разблокировка учетной записи windows 10 через реестр
  • Разблокировка по отпечатку пальца windows 10