This Windows Server 2022 Tutorial covers how to Enable Remote Desktop Protocol (RDP) on Windows Server 2022. Remote Desktop Protocol is a proprietary protocol developed by Microsoft that allows a user can connect to another computer.
Table of Contents
- Enable Remote Desktop to connect to the Server from other Computers
- Connect to Remote Desktop session from Client OS.
Server Demo environment
- Computer Name: server1
- Operating System: Windows Server 2022 Datacenter
- IP Address: 192.168.3.3
Enable Remote Desktop to connect to the Server from other Computers
The default port number of Remote Desktop Protocol (RDP) is 3389, Remote desktop service is disabled by default. To enable Remote Desktop in Windows Server 2022, you need to log in with a local administrator account to make the changes.
1. Open Server Manager, click on Local Server and Click on Disabled for Remote Desktop section.
2. Select Allow remote connections to this computer.
3. The message that Firewall exception for Remote desktop is enabled, Click on OK.
4. Ensure the option Allow connections only from computers running Remote Desktop with Network Level Authentication is enabled and click OK.
Connect to Remote Desktop session from Client OS.
Make sure the client and the server are on the same network.
Client Demo environment
- Computer Name: server2
- Operating System: Windows Server 2022 Datacenter
- IP Address: 192.168.3.4
5. Right-click the Windows icon and open run and input mstsc
and Click OK
6. Enter the Hostname or IP address you’d like to connect to. In this tutorial, we use the IP address for connecting.
- Computer: 192.168.3.3
7. Enter the Username and Password of the remote server and click OK.
- User Name: server1\administrator
- Password: *******
8. Click Yes.
Why Enable Remote Desktop on Windows Server 2022?
Remote Desktop Protocol (RDP)
is a powerful tool for accessing Windows servers from remote locations. It allows administrators to perform system maintenance, deploy applications, and troubleshoot issues without physical access to the server. By default, Remote Desktop is disabled on Windows Server 2022 for security purposes, necessitating deliberate configuration to enable and secure the feature.
RDP also simplifies collaboration by enabling IT teams to work on the same server environment simultaneously. Additionally, businesses with distributed workforces depend on RDP for efficient access to centralized systems, boosting productivity while reducing infrastructure costs.
Methods to Enable Remote Desktop
There are several ways to enable Remote Desktop in Windows Server 2022, each tailored to different administrative preferences. This section explores three primary methods: the GUI, PowerShell, and Remote Desktop Services (RDS). These approaches ensure flexibility in configuration while maintaining high standards of precision and security.
Enabling Remote Desktop via the Server Manager (GUI)
Step 1: Launch Server Manager
The Server Manager is the default interface for managing Windows Server roles and features.
Open it by:
-
Clicking the Start Menu and selecting Server Manager.
-
Alternatively, use the Windows + R key combination, type ServerManager, and press Enter.
Step 2: Access Local Server Settings
Once in Server Manager:
-
Navigate to the Local Server tab in the left-hand menu.
-
Locate the «Remote Desktop» status, which typically shows «Disabled.»
Step 3: Enable Remote Desktop
-
Click on «Disabled» to open the System Properties window in the Remote tab.
-
Select Allow remote connections to this computer.
-
For enhanced security, check the box for Network Level Authentication (NLA), requiring users to authenticate before accessing the server.
Step 4: Configure Firewall Rules
-
A prompt will appear to enable the firewall rules for Remote Desktop.
Click OK. -
Verify the rules in the Windows Defender Firewall settings to ensure port 3389 is open.
Step 5: Add Authorized Users
-
By default, only administrators can connect. Click Select Users… to add non-administrator accounts.
-
Use the Add Users or Groups dialog to specify usernames or groups.
Enabling Remote Desktop via PowerShell
Step 1: Open PowerShell as Administrator
-
Use the Start Menu to search for PowerShell.
-
Right-click and select Run as Administrator.
Step 2: Enable Remote Desktop via Registry
-
Run the following command to modify the registry key controlling RDP access:
-
Set-ItemProperty -Path ‘HKLM:\System\CurrentControlSet\Control\Terminal Server’ -Name «fDenyTSConnections» -Value 0
Step 3: Open the Necessary Firewall Port
-
Allow RDP traffic through the firewall with:
-
Enable-NetFirewallRule -DisplayGroup «Remote Desktop»
Step 4: Test Connectivity
-
Use PowerShell’s built-in networking tools to verify:
- Test-NetConnection -ComputerName -Port 3389
Installing and Configuring Remote Desktop Services (RDS)
Step 1: Add the RDS Role
-
Open Server Manager and select Add roles and features.
-
Proceed through the wizard, selecting Remote Desktop Services.
Step 2: Configure RDS Licensing
-
During the role setup, specify the licensing mode: Per User or Per Device.
-
Add a valid license key if required.
Step 3: Publish Applications or Desktops
-
Use the Remote Desktop Connection Broker to deploy remote apps or virtual desktops.
-
Ensure users have appropriate permissions to access published resources.
Securing Remote Desktop Access
While enabling
Remote Desktop Protocol (RDP)
on Windows Server 2022 provides convenience, it can also introduce potential security vulnerabilities. Cyber threats like brute-force attacks, unauthorized access, and ransomware often target unsecured RDP setups. This section outlines best practices to secure your RDP configuration and protect your server environment.
Enable Network Level Authentication (NLA)
Network Level Authentication (NLA) is a security feature that requires users to authenticate before a remote session is established.
Why Enable NLA?
-
It minimizes exposure by ensuring only authorized users can connect to the server.
-
NLA reduces the risk of brute-force attacks by blocking unauthenticated users from consuming server resources.
How to Enable NLA
-
In the System Properties window under the Remote tab, check the box for Allow connections only from computers running Remote Desktop with Network Level Authentication.
- Ensure client devices support NLA to avoid compatibility issues.
Restrict User Access
Limiting who can access the server via RDP is a critical step in securing your environment.
Best Practices for User Restrictions
-
Remove Default Accounts: Disable or rename the default Administrator account to make it harder for attackers to guess credentials.
-
Use the Remote Desktop Users Group: Add specific users or groups to the Remote Desktop Users group.
Avoid granting remote access to unnecessary accounts. -
Audit User Permissions: Regularly review which accounts have RDP access and remove outdated or unauthorized entries.
Enforce Strong Password Policies
Passwords are the first line of defense against unauthorized access. Weak passwords can compromise even the most secure systems.
Key Elements of a Strong Password Policy
-
Length and Complexity: Require passwords to be at least 12 characters long, including uppercase letters, lowercase letters, numbers, and special characters.
-
Expiration Policies: Configure policies to force password changes every 60–90 days.
-
Account Lockout Settings: Implement account lockout after a certain number of failed login attempts to deter brute-force attacks.
How to Configure Policies
-
Use Local Security Policy or Group Policy to enforce password rules:
-
Navigate to Computer Configuration > Windows Settings > Security Settings > Account Policies > Password Policy.
-
Adjust settings such as minimum password length, complexity requirements, and expiration duration.
-
Restrict IP Addresses
Restricting RDP access to known IP ranges limits potential attack vectors.
How to Restrict IPs
-
Open Windows Defender Firewall with Advanced Security.
-
Create an Inbound Rule for RDP (
port 3389
):
-
Specify the rule applies only to traffic from trusted IP ranges.
-
Block all other inbound traffic to RDP.
-
Benefits of IP Restrictions
-
Drastically reduces exposure to attacks from unknown sources.
-
Provides an additional layer of security, especially when combined with VPNs.
Implement Two-Factor Authentication (2FA)
Two-Factor Authentication adds an extra layer of protection by requiring users to verify their identity with something they know (password) and something they have (e.g., a mobile app or hardware token).
Setting Up 2FA for RDP
-
Use third-party solutions such as DUO Security or Authy to integrate 2FA with Windows Server.
-
Alternatively, configure Microsoft Authenticator with Azure Active Directory for seamless integration.
Why Use 2FA?
-
Even if a password is compromised, 2FA prevents unauthorized access.
-
It significantly enhances security without compromising user convenience.
Testing and Using Remote Desktop
After successfully enabling
Remote Desktop Protocol (RDP)
on your Windows Server 2022, the next critical step is testing the setup. This ensures connectivity and verifies that the configuration works as expected. Additionally, understanding how to access the server from various devices—regardless of the operating system—is essential for a seamless user experience.
Testing Connectivity
Testing the connection ensures the RDP service is active and accessible over the network.
Step 1: Use the Built-in Remote Desktop Connection Tool
On a Windows machine:
-
Open the Remote Desktop Connection tool by pressing Windows + R, typing mstsc, and pressing Enter.
-
Enter the server’s IP address or hostname in the Computer field.
Step 2: Authenticate
-
Input the username and password of an account authorized for remote access.
-
If using Network Level Authentication (NLA), ensure the credentials match the required security level.
Step 3: Test the Connection
-
Click Connect and verify that the remote desktop session initializes without errors.
-
Troubleshoot connectivity issues by checking the firewall, network configurations, or server status.
Accessing from Different Platforms
Once the connection has been tested on Windows, explore methods for accessing the server from other operating systems.
Windows: Remote Desktop Connection
Windows includes a built-in Remote Desktop client:
-
Launch the Remote Desktop Connection tool.
-
Input the IP address or hostname of the server and authenticate.
macOS: Microsoft Remote Desktop
-
Download Microsoft Remote Desktop from the App Store.
-
Add a new PC by entering the server details.
-
Configure optional settings such as display resolution and session preferences for an optimized experience.
Linux
:
RDP Clients like Remmina
Linux users can connect using RDP clients such as Remmina:
-
Install Remmina via your package manager (e.g., sudo apt install remmina for Debian-based distributions).
-
Add a new connection and select RDP as the protocol.
-
Provide the server’s IP address, username, and password to initiate the connection.
Mobile Devices
Accessing the server from mobile devices ensures flexibility and availability:
iOS:
-
Download the Microsoft Remote Desktop app from the App Store.
-
Configure a connection by providing the server’s details and credentials.
Android:
-
Install the Microsoft Remote Desktop app from Google Play.
-
Add a connection, enter the server’s IP address, and authenticate to begin remote access.
Troubleshooting Common Issues
Connectivity Errors
-
Check that
port 3389
is open in the firewall.
-
Confirm the server is accessible via a ping test from the client device.
Authentication Failures
-
Verify the username and password are correct.
-
Ensure the user account is listed in the Remote Desktop Users group.
Session Performance
-
Reduce display resolution or disable resource-intensive features (e.g., visual effects) to improve performance on low-bandwidth connections.
Explore Advanced Remote Access with TSplus
For IT professionals seeking advanced solutions,
TSplus Remote Access
offers unparalleled functionality. From enabling multiple concurrent connections to seamless application publishing and enhanced security features, TSplus is designed to meet the demands of modern IT environments.
Streamline your remote desktop management today by visiting
TSplus
.
Conclusion
Enabling Remote Desktop on Windows Server 2022 is a critical skill for IT administrators, ensuring efficient remote management and collaboration. This guide has walked you through multiple methods to enable RDP, secure it, and optimize its usage for professional environments. With robust configurations and security practices, Remote Desktop can transform server management by providing accessibility and efficiency.
TSplus Remote Access Free Trial
Ultimate Citrix/RDS alternative for desktop/app access.Secure, cost-effective,on-permise/cloud
RDP (Remote Desktop Protocol) – это протокол или технический стандарт, который применяется для организации удалённой работы пользователя с сервером.
Клиенты существуют практически для всех версий Windows (включая Windows CE, Phone и Mobile), Linux, FreeBSD, Mac OS X, iOS, Android, Symbian.
В этой статье мы предлагаем вам рассмотреть RDP windows server через призму облачного сервера от SIM-Networks. Мы покажем, как легко подключиться к удаленному серверу, проведем вас через каждый шаг.
Подготовительный этап
Чтобы начать работу с RDP, вам потребуется сервер или облачное решение с предустановленной операционной системой Windows. Каждая ОС имеет свои минимальные требования к вычислительным мощностям. С учетом того, что RDP часто используется для рабочих задач, важно, чтобы сервер соответствовал этим требованиям. Наши облачные серверы обеспечивают достаточные вычислительные ресурсы для эффективной работы и автоматическое резервное копирование данных.
В этой инструкции установку службы удаленных рабочих столов мы реализуем с помощью облака SIM-Networks с процессором Intel Xeon с 4 ядрами, 16 ГБ оперативной памяти и хранилищем 100 Гб (пакет Marin).
Для доступа к вашему облачному серверу вы получите по электронной почте уникальный логин и пароль. Эти учетные данные необходимы для подключения к облачной панели управления.
Чтобы подключится к вашему облачному серверу, просто перейдите на нашу веб-платформу и введите предоставленные учетные данные.
Для тех, кто предпочитает визуальное руководство, мы также предлагаем видеоинструкцию по подключению к облачному серверу по RDP.
Установка роли RDP на сервер Windows происходит в два этапа: вначале устанавливается служба удаленных рабочих столов, после этого определяем сервер лицензирования.
1. Установка службы удаленных рабочих столов
Перед началом настроек необходимо установить имя самого сервера:
Пуск → Диспетчер серверов → Локальный сервер → Выполнить нажатие на текущее имя компьютера для его изменения.
Попав после этого на страницу Свойства системы нажимаем кнопку Изменить, после чего переходим на страницу изменения имени компьютера. Указываем желаемое имя, жмем ОК. В результате получаем системное сообщение о том, что для применения новой настройки понадобится перезагрузка. Перезагрузку можно выполнить как сразу, так и позже самостоятельно.
После перезагрузки сервера мы можем приступить непосредственно к установке службы каталогов Active Directory:
Пуск → Диспетчер сервервов → Добавить роли и компоненты:
В открывшемся диалоговом окне выберем пункт Установка ролей и компонентов:
Далее необходимо выбрать сервер, на который мы будем производить установку роли AD. Из списка Пул серверов выбираем наш сервер SRV01 и жмем Далее:
Затем появится список доступных ролей для установки на наш сервер. В данном случае нас интересует роль с названием Доменные службы Active Directory. Отметив этот пункт, мы откроем список всех необходимых компонентов, которые будут установлены для базового функционирования роли AD. Также во время выбора ролей для установки можно установить роль DNS-сервера. Во всех оставшихся диалоговых окнах жмем кнопку Далее. На самом последнем этапе жмем Установить для установления роли:
По завершении установки перейдем снова в пункт меню Пуск → Диспетчер серверов → Добавить роли и компоненты. Как и на изображении ниже, после установления новой роли появится иконка в виде желтого треугольника:
Повышаем роль сервера до уровня контроллера домена, нажав одноименную кнопку.
Затем, после выбора пункта Добавить новый лес, указываем название нашего домена и жмем Далее:
Совместимость работы леса и корневого домена оставляем Windows Server 2012 R2.
Отмечаем пункты DNS-сервер и Глобальный каталог (GC).
Устанавливаем пароль для восстановления служб каталогов, если в будущем возникнет такая необходимость:
На следующей вкладке мы получим предупреждение о том, что невозможно выполнить делегирование для этого DNS-сервера, игнорируем сообщение и переходим к следующему окну:
На следующей вкладке NetBIOS имя оставляем без изменений:
На следующем этапе будут отображены пути к файлам базы, оставляем их также без изменений:
Нажав Далее мы перейдем к списку суммарных настроек, после этого можно переходить непосредственно к этапу самой установки. Буду выполнены автоматические проверки на корректность установленных параметров и настроек, после чего кнопка Установить станет доступной:
По завершении установки сервер будет перезагружен.
Централизованное управление пользователями, группами, их редактированием, добавлением и удалением теперь можно выполнять через оснастку Центр администрирования Active Directory в меню Диспетчера серверов, с вкладки Средства:
2. Определение сервера лицензирования для службы удаленных рабочих столов
Приступим к установке терминального сервера:
Пуск → Диспетчер серверов → Добавить роли и компоненты. Оставляем на следующем диалоговом окне выбранный пункт Установка ролей и компонентов и переходим далее:
Выбираем в диалоговом окне пункт Выбор целевого сервера и жмем Далее:
Переходим к выбору конкретной роли для сервера, которую хотим установить. В данном случае – Службы удаленных рабочих столов:
Переходим к следующему окну Компоненты. Оставляем всё как есть, без изменений, и переходим далее:
Ознакомимся с описанием службы удаленных рабочих столов и нажимаем Далее:
Теперь необходимо выбрать устанавливаемые службы ролей. Нам необходима роль Лицензирование удаленных рабочих столов. Отмечаем соответствующий пункт, в открывшемся дочернем окне подтверждаем добавление компонентов этой роли, переходим к этапу установки и ждем ее успешного завершения.
После установки потребуется перезагрузка сервера:
Для установки лицензий понадобится задать режим лицензирования для терминального сервера.
В Windows Server 2012 это выполняется через панель управления групповыми политиками. Откроем командную строку и пропишем команду gpedit.msc:
По этой команде откроется редактор групповых политик. Переходим по пути:
Конфигурация компьютера → Административные шаблоны → Компоненты Windows → Службы удаленных рабочих столов → Узел сеансов удаленных рабочих столов → Лицензирование
Тут нас интересуют два параметра: Использовать указанные серверы лицензирования удаленных рабочих столов и Задать режим лицензирования удаленных рабочих столов:
Откроем для редактирования первый параметр и укажем сервер лицензирования. Поскольку он располагается на нашем сервере, то указываем имя нашего сервера (SRV01) или наш IP-адрес и меняем состояние политики на Включено:
Меняем второй параметр групповой политики. Нам необходимо выбрать, каким образом будет происходить процедура лицензирования. Есть два варианта: На устройство, либо На пользователя.
При 5 лицензиях и режиме На устройство можно создать неограниченное число пользователей на сервере, которые смогут подключаться через удаленный рабочий стол только с 5 компьютеров, на которых установлены эти лицензии. Если выбрать режим На пользователя, то зайти на сервер смогут только 5 выбранных пользователей, независимо от того, с какого устройства они выполняют подключение. В нашем примере мы выбираем вариант лицензирования На пользователя.
Вернемся в оснастку Средство диагностики лицензирования удаленных рабочих столов и видим ошибку, говорящую о том, что сервер лицензирования указан, но не включен:
Исправим эту ошибку, активировав сервер лицензирования. Перейдем в Диспетчер лицензирования удаленных рабочих столов:
Видим, что статус нашего сервера лицензирования – Не активирован.
Чтобы активировать его, жмем правой кнопкой мыши, и в появившемся контекстном меню выбираем пункт Активировать сервер. После чего откроется мастер активации сервера:
Жмем Далее и переходим к следующему пункту выбора метода подключения, оставляем пункт Авто:
Далее потребуется ввести сведения для организации, где все поля обязательны для заполнения.
А также дополнительные сведения об организации, которые являются необязательными:
Затем появится сообщение о активации сервера лицензирования. Осталось выполнить установку лицензий на сервер. Оставим включенным пункт Запустить мастер установки лицензий в финальном окне активации сервера лицензирования:
3. Установка лицензий на сервере лицензий Remote Desktop
Запустится мастер установки лицензий:
Нам необходимо в следующем окне выбрать программу, на основе которой получены наши лицензии. В примере рассматривается тип Соглашение «Enterprise Agreement»:
Переходим к следующему окну и вводим номер нашего соглашения:
Указываем версию продукта, тип лицензии и количество лицензий в соответствии с нашей программой лицензирования:
Дождемся, пока мастер установки активирует лицензии:
Убедимся, что сервер лицензирования работает, и проверим число установленных лицензий в диспетчере лицензирования:
После этого можно выполнять многопользовательское подключение клиентов, например, через встроенный в Windows клиент Подключение к удаленному рабочему столу. Также необходимо заметить, что пользователь, которому нужен доступ к подключению через удаленный рабочий стол, должен состоять в группе Пользователи удаленного рабочего стола.
Эта статья была полезной?
Также читайте
Previous
Next
Протокол Remote Desktop Protocol (RDP) позволяет удаленно подключиться к рабочему столу компьютера с Windows и работать с ним, как будто это ваш локальный компьютер. По умолчанию RDP доступ в Windows запрещен. В этой статье, мы покажем, как включить и настроить RDP доступ в Windows 10 и Windows Server 2016/2019.
Содержание:
- Включаем удаленный рабочий стол в Windows 10
- Как включить RDP доступ с помощью PowerShell?
- RDP доступ к Windows Server 2016/2019
- Включение RDP с групповых политик в домене Active Direcrtory
- Как удаленно включить RDP на компьютере Windows?
Включаем удаленный рабочий стол в Windows 10
Самый простой способ включить RDP доступ в Windows – воспользоваться графическим интерфейсом.
Откройте свойства системы через панель управления, или выполнив команду SystemPropertiesRemote.
Перейдите на вкладку Remote Settings (Удаленный доступ), включите опцию Allow remote connection to this computer (Разрешить удалённые подключения к этому компьютеру).
В целях безопасности желательно разрешить подключение только с клиентов RDP с поддержкой протокола NLA (Allow connections only from computers running Remote Desktop with Network Level Authentication/ Разрешить подключение только с компьютеров, на которых работает удаленный рабочий стол с проверкой подлинности на уровне сети).
Сохраните изменения, нажав ОК.
По умолчанию право на подключение к компьютеру через RDP есть только у членов группы локальных администраторов. Если вам нужно разрешить RDP доступ другим пользователям, нажмите кнопку Select Users.
Все пользователи, которых вы укажете здесь будет добавлены в локальную группу Remote Desktop Users. Вы можете в командной строке вывести список пользователей в этой группе:
net localgroup "Remote Desktop Users"
или
net localgroup “Пользователи удаленного рабочего стола”
Чтобы добавить нового пользователя в группу доступа RDP, выполните:
net localgroup "Remote Desktop Users" /add publicuser
В русской версии Windows измените название группы на “Пользователи удаленного рабочего стола”.
В новых билдах Windows 10 классическая панель для включения RDP доступа теперь спрятана и Microsoft рекомендует пользоваться новой панелью Setting.
- Перейдите в Settings -> System —> Remote Desktop;
- Включите опцию Enable Remote Desktop;
- Подтвердите включение RDP на компьютере.
Обратите внимание, что вы не можете включить RDP доступ к редакции Windows 10 Home. RDP сервер работает только на Windows 10 Pro и Enterprise. Впрочем, есть обходное решение.
Обратите внимание, что по умолчанию при включении Remote Desktop, включаются две опции:
- Keep my PC awake for connection when it is plugged in ;
- Make my PC discoverable on private networks to enable automatic connection from a remote device
На жмите на ссылку “Advanced settings”. Здесь можно включить использование протокола “Network Level Authentication” для RDP подключений (рекомендуется).
Если на компьютере включен Windows Defender Firewall (брандмауэр), то нужно проверить, что в нем разрешены входящие RDP подключения. По умолчанию для RDP подключений используется порт TCP
3389
, а в последних билдах Windows также используется
UDP 3389
( см. статью про кейс с черным экраном вместо рабочего стола при RDP доступе).
Перейдите в панель управления и выберите элемент Windows Defender Firewall. Откройте список стандартных правил брандмауэра Windows, щелкнув в левом столбце по ссылке Allow an app or feature through Windows Firewall.
Проверьте, что правило Remote Desktop включено для профиля Private (домашняя или рабочая сеть) и, если необходимо, для профиля Public (общедоступные сети).
Подробнее про типы сетей и профили брандмауэра Windows здесь.
Если нужно, вы можете дополнительно ограничить длительность RDP сессий с помощью GPO.
Теперь к данному компьютеру можно подключится с помощью RDP клиента. Встроенный RDP клиент Windows –
mstsc.exe
. Он сохраняет всю историю RDP подключений с компьютера. Поддерживается копирование файлов между локальным и удаленным компьютером прямо через буфер обмена RDP.
Также вы можете использовать менеджеры RDP подключений, такие как RDCMan или mRemoteNG, или альтернативные клиенты.
Для удобства пользователей пароль для RDP подключения можно сохранить в Windows Credential Manager.
Как включить RDP доступ с помощью PowerShell?
Вы можете включить RDP доступ в Windows с помощью пары PowerShell команд. Это гораздо быстрее:
- Запустите консоль PowerShell.exe с правами администратора;
- Включите RDP доступ в реестре с помощью командлета Set-ItemProperty:
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0
Чтобы закрыть RDP доступ, измените значение fDenyTSConnections на 1.
- Разрешите RDP подключения к компьютеру в Windows Defender Firewall. Для этого включите предустановленное правило :
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
- Если нужно добавить пользователя в группу в локальную группу RDP доступа, выполните:
Add-LocalGroupMember -Group "Remote Desktop Users" -Member 'a.petrov'
Чтобы проверить, что на компьютере открыт RDP порт, воспользуйтесь командлетом Test-NetConnection:
Test-NetConnection -ComputerName deskcomp323 -CommonTCPPort rdp
RDP доступ к Windows Server 2016/2019
В отличии от десктопной редакции Windows 10, в Windows Server по умолчанию поддерживается два одновременных RDP подключения. Эти подключения используются администраторами для управления сервером.
Включается RDP в Windows Server аналогично. Через SystemPropertiesRemote, через Server Manager или командами PowerShell, рассмотренными выше.
Вы можете использовать Windows Server в качестве терминального сервера. В этом случае множество пользователей могут одновременно подключаться к собственному рабочему столу на сервере. Для этого нужно установить и настроить на сервере роль Remote Desktop Session Host. Это требует приобретения специальных RDS лицензии (CAL). Подробнее о RDS лицензировании здесь.
Для дополнительно защиты RDP сессий можно использовать SSL/TLS сертификаты.
Включение RDP с групповых политик в домене Active Direcrtory
Если вам нужно включить RDP доступ сразу на большом количестве компьютеров, можно воспользоваться групповыми политиками (GPO). Мы подразумеваем, что все компьютеры включены в домен Windows.
- Запустите консоль управления доменными GPO
gpmc.msc
; - Создайте новую (или отредактируйте уже существующую) групповую политику и привяжите ее к целевой OU с компьютерами или серверами;
- Переключитесь в режим редактирования политики и перейдите в секцию GPO Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Connections;
- Найдите и включите политику Allow Users to connect remotely by using Remote Desktop Services, установив ее в Enable;
- Обновите параметры групповых политик на клиентах;
- После применения данной политики вы сможете подключится ко всем компьютерам по RDP (политика применится как к десктопным клиентам с Windows 10, так и к Windows Server). Если нужно, вы можете более тонко нацелить политики на компьютеры с помощью WMI фильтров GPO.
- Если на компьютерах включен Windows Defender Firewall, нужно в этой же GPO разрешить RDP-трафик для доменного профиля. Для этого нужно активировать правило Windows Firewall: Allow inbound Remote Desktop Exceptions (находится в разделе Computer Configuration -> Administrative Templates -> Network -> Network Connections -> Windows Firewall -> Domain Profile).
Подробнее о настройке правил брандмаура Windows через GPO рассказано здесь.
Как удаленно включить RDP на компьютере Windows?
Также вы можете удаленно включить RDP на любом компьютере Windows. Для этого у вас должен быть удаленный доступ к этому компьютеру (через PowerShell или WMI) и ваша учетная запись состоять в группе локальных администраторов на этом компьютере.
Вы можете удаленно включить RDP через реестр. Для этого на удаленном компьютере должна быть включена служба Remote Registry (по умолчанию она отключена). Чтобы запустить службу:
- Запустите консоль управления службами (
services.msc
); - Выберите Connect to another computer и укажите имя удаленного компьютера;
- Найдите в списке службу Remote Registry, измените тип запуска на Manual (ручной) и затем запустите службу – Start.
Тоже самое можно выполнить удаленно из командной строки с помощью встроенной утилиты
sc
(позволяет создавать, управлять или удалять службы Windows):
sc \\WKMDK22SQ65 config RemoteRegistry start= demand
sc \\WKMDK22SQ65 start RemoteRegistry
Затем на локальном компьютере
- Запустите редактор реестра
regedit.exe
- Выберите в меню Файл пункт Connect Network Registry (Подключить сетевой реестр)
- Укажите имя или IP адрес удаленного компьютера, на котором нужно включить службу RDP;
- Перейдите в раздел
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
; - Найдите параметр fDenyTSConnections (тип REG_DWORD). Если данный ключ отсутствует – создайте его. Измените его значение на 0, чтобы включить RDP.
Для отключения RDP доступа нужно изменить значение fDenyTSConnections на 1.
Сразу после этого без перезагрузки удаленный компьютер должен стать доступным по RDP.
Но гораздо быстрее можно включить RDP в реестре удаленого компьютера через командную строку:
REG ADD "\\WKMDK22SQ65\HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
Если на удаленном компьютере настроен PowerShell remoting, вы можете выполнить на нем удаленную команду через Invoke-Command:
Invoke-Command -Computername WKMDK22SQ65 -ScriptBlock {Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" –Value 0}
Если в Windows установлен OpenSSH сервер, вы можете подключиться к нему любым ssh клиентом и внести изменения в реестр в локальной ssh сессии.
Также вы можете подключиться к удаленному компьютеру и включить RDP через WMI:
$compname = “WKMDK22SQ65”
(Get-WmiObject -Class Win32_TerminalServiceSetting -Namespace root\CIMV2\TerminalServices -Computer $compname -Authentication 6).SetAllowTSConnections(1,1)
How to set up RDP on Windows Server 2019 is an essential task for administrators who need to access and manage servers remotely. RDP allows users to connect to another computer over a network and interact with it as though they were sitting in front of it. In this guide, we’ll cover everything from configuring the Remote Desktop feature to securing the connection to ensure a smooth and secure setup.
1. Prerequisites for Remote Desktop Setup
Before configuring Remote Desktop on your Windows Server 2019, ensure that you have:
- Administrative privileges on the server.
- A stable network connection between the local machine and the server.
- A valid license for Remote Desktop Services if you plan to use it with multiple users simultaneously (RDS setup).
- A firewall configured to permit RDP connections (default port: 3389).
2. Enable Remote Desktop on Windows Server 2019
By default, Remote Desktop is disabled on Windows Server 2019 for security reasons. Follow these steps to enable it:
Step-1: Access Server Manager
- Open Server Manager by clicking on the Start button or typing “Server Manager” in the search bar.
- Once Server Manager is open, navigate to Local Server from the left-hand panel.
Step-2: Enable Remote Desktop
- In the Properties section of Local Server, find the option labeled Remote Desktop.
- Click on the “Disabled” status to open the system properties window.
Step-3: Allow Remote Connections
- In the Method Properties window under the Remote tab, select Allow remote connections to this computer.
- For better security, it’s recommended to check the box for Allow connections only from computers running Remote Desktop with Network Level Authentication (NLA).
Step-4: Apply Settings
- Click Apply and then OK to enable Remote Desktop.
3. Configure Remote Desktop Users
By default, only administrators can log in via Remote Desktop. If you want to allow other users access, follow these steps:
Step-1: Open System Properties
- Go back to the Remote tab in the System Properties window.
Step-2: Add Users
- Click the Select Users button. A dialog box will appear allowing you to add specific users or groups.
- Type in the names of users or groups you want to grant RDP access and click OK.
4. Configure Firewall to Allow Remote Desktop
Once Remote Desktop is enabled, ensure that your server’s firewall is configured to allow incoming RDP traffic. Here’s how to do it:
Step-1: Open Firewall Settings
- In Server Manager, press on Tools and select Windows Defender Firewall with Advanced Security.
Step-2: Create a New Rule
- In the left-hand panel, click on Inbound Rules.
- In the right-hand panel, click on New Rule.
Step-3: Enable RDP Port
- Choose Port as the rule type, and then click Next.
- Specify the protocol as TCP and type 3389 in the specific port field. Click Next.
- Allow the connection, select the network profiles you want this rule to apply to (Domain, Private, Public), and then name the rule, for example, “Allow RDP”.
- Click Finish to create the rule and allow Remote Desktop connections.
5. Connecting to the Server Using Remote Desktop
Now that you’ve configured your server for Remote Desktop, you can connect to it from another machine. Here’s how:
Step-1: Open Remote Desktop Connection
- On your local machine, press Win + R, type mstsc, and press Enter to open the Remote Desktop Connection tool.
Step-2: Enter Server Details
- In the Computer field, enter the IP address or the hostname of your Windows Server 2019 machine.
Click Connect.
Step-3: Log In
- When prompted, enter the credentials (username and password) for a user account that has RDP access to the server.
If you are connecting for the first time, you may receive a warning about the server’s certificate. You can choose to Accept and continue with the connection.
6. Optimizing Performance for Remote Desktop
Depending on your network bandwidth and usage, you may want to optimize your Remote Desktop connection to ensure smoother performance. Here are some tips:
- Adjust Remote Desktop Display Settings
- When launching the Remote Desktop tool, click Show Options before connecting.
- Under the Display tab, reduce the Color depth to 16-bit or adjust the screen resolution to match your requirements.
- Disable Resource-Intensive Features
- Under the Experience tab, choose an appropriate connection speed based on your network.
- Uncheck resource-heavy options like Desktop background, Font smoothing, and Persistent bitmap caching if you’re experiencing lag.
7. Securing Remote Desktop on Windows Server 2019
To protect your server from unauthorized access, you must take additional steps to secure the RDP connection.
Step-1: Change the RDP Port
-
- By default, RDP uses port 3389, which is commonly targeted by attackers. Changing this port can help reduce exposure.
- You can modify the RDP listening port by editing the Windows Registry:
- Open the Registry Editor (regedit), navigate to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp.
- Find the PortNumber key, change its value to a new port number, and restart the server.
Step -2: Enable Network Level Authentication (NLA)
- Network Level Authentication adds a layer of security by requiring users to authenticate before establishing a full RDP session.
- Ensure that NLA is enabled in the Remote Desktop settings under the Remote tab.
Step-3: Enable Two-Factor Authentication
- Adding two-factor authentication (2FA) is another way to secure your RDP connections. Many third-party tools, such as Duo Security, can be integrated with Windows Server to provide 2FA for Remote Desktop.
Step-4: Limit User Access and Permissions
- Make sure only the necessary users or administrators have RDP access. Consider creating separate accounts for users who need limited access to specific server resources.
Step-5: Use a VPN
- For additional security, consider setting up a VPN to connect to the server. By doing so, you’ll restrict RDP access to users connected via the secure VPN tunnel.
Conclusion
Setting up Remote Desktop on Windows Server 2019 is a straightforward process, but securing it is just as important. By enabling the right features, optimizing performance, and securing the connection, you can enjoy seamless and safe remote access to your server. Whether for administration, troubleshooting, or working remotely, Remote Desktop is a powerful tool that can streamline server management when configured correctly.