Remote connection windows command

Enable remote desktop from command line (CMD)

Remote desktop can be enabled/disabled by opening My computer properties and then by changing the settings in the ‘Remote‘ tab. We can do the same by editing registry key settings. This is explained below. Remote desktop is also called Terminal services or TS or RDP. This is an in-built remote desktop software for Windows users.

Enable remote desktop from CMD

  • Open registry editor by running regedit from Run.
  • Go to the node
  • Change the data of the value fDenyTSConnections to 0.

We can enable remote desktop from windows command line by running the following command.

To disable remote desktop we need to run the below command.

Reboot or logoff is not required after running the above command. I have tested this on Windows XP and Windows 7 and it has worked fine. It would work fine on Windows Vista too.

Enable Remote assistance:

Thanks for sharing this.. I want to enable and disable remote desktop to test a scenario. I need to do this repeatedly so was looking for command line way of the same.

Thanks so much! This was very helpful. One hint to those that follow – I found that if I copied & pasted directly from this page – the ” symbols were corrupted and gave me a different character set which did not work in the bat file. You have to either paste as text or delete & retype the “s.

Thanks Jo for pointing that out. Now I have placed the commands in a code block ; copy & paste would work fine.

How do you go a step further and add in the trusted users/groups for remote desktop? It puts in administrators by default, but I have to manually go in and add “domain users” to each machine.

Option 1:
You can run the below command for each user you want to allow to connect remotely.

Option 2:
If you have a group of domain users and want to allow the whole group to do remote desktop on the computer, you can do that as well with a single command. Just replace the loginid in the above command with the group name.

Thanx for this cool tip it helped me in creating my batch file which maybe dangerous for my target friends… 🙂

I want to create something like this as well but there’s a few problems

great job. thank u

So, i take the given command line to enable or disable the remote access, but it tells me Error: Access denied

I guess you are not running it from elevated command prompt.

I have a question to
Danish November 10, 2011 at 8:35 pm Feed.

How can we determine target machine? By the code posted by Danish.

Where /f = full screen

/v:–specifies the name of the computer to connect to.
/f–starts the connection in a full screen.
/w:–specifies the width of the remote desktop screen.
/h:–specifies the height of the remote desktop screen

eg
mstsc /v: JD2043614 /f

Thank you for your information..

Awesome…
Thanks man…

How can i add specific IPs to allow remote session?
Regards,
[email protected]

you may have to configure your firewall to allow only certain IPs to connect to 3389. I’m sure Terminal Services also has some built in filters too…

Thank! good shared

Thank you for suggestion.
Please send me your email id. i can learn many more.

Thanks, This post help me lot.

hi danish,
this batch file will act on every Windows edition

im in the same network with my junior,i want to enable his remote access over the network.i can ping his computer and respond.i have his computer name and i.p address.network users are not in domain,they are in workgroup.how can you assist me without going to the user’s desk?

You could use PsExec to open an remote command prompt. Thus you need to download PsTools Suite from Microsoft Tech-Net.

Hi, i need to disable/enable remote desktop on my server during the time i run some automation. The tip you suggested works on all of my servers except for the one that i really need. Would you know of any other parameter that could disable that registry key?

Читайте также:  Linux если нет шрифта браузер

Yeah, this doesn’t work. You’re missing one critical step – opening the firewall
netsh firewall set service remotedesktop enable

mstsc /v:SERVER /admin

lol lol lol thank you Matthew Bradley, I couldn’t find this vital piece of information for like 20 minutes on google.

I wonder can anyone write a script like that to automate this whole thing (including firewall, elevated cmd line etc)? C+ may be. May be even for a reasonable donation))

Why to enable RDP from command line? Simple use remote access tools.

HUGE help, I’m in MA, remote system in CA, no one in the office right now. I’m running Teamviewer for remote access and I just upgraded. Post upgrade the system is almost entirely hung, can’t do much of anything (though I can run a command prompt). I enabled RDP, logged on and reinstalled TV. Thanks so much!

Run command for remote desktop (RDP client)

The Run command for Windows Remote desktop application is Mstsc

Just open Run from start menu and type mstsc in the text box next to open and press enter.

This command mstsc can be used from command line too.

A system running Windows 7/Windows 10 allows only one remote desktop connection at a time, means only one remote user can work on it any time. A computer running Windows server edition can support remote sessions for multiple users at the same time.

Mstsc command

Every time we connect to the server it opens a new user session. To avoid this we can open a connection to the console. This allows us to login back to the same user session if we already have one. To do this we need to add /console switch to the mstsc command.

This command can be run from command prompt or from Run window.

Run command for opening remote desktop session in full screen mode

Add /f switch to the command.

Run command for specifying the remote computer name from the command itself

Use /v switch in this case.

Run command to specify remote desktop connection settings using a rdp file

A RDP file can be created using the ‘Save As‘ button in the General tab in mstsc(Remote desktop connection client) window.

These commands work on XP, Vista, Windows 7 and Server 2003/2008 operating systems.

Run command for Remote desktop manager

There is no Run command for opening remote desktop connection manager directly. It is usually installed in the path C:\Program Files\Remote Desktop Connection Manager\RDCman.exe . By specifying this complete path we can launch connection manager.

Relevant Posts:

Good information on the command line switches available with the mstsc command. thank you.

i would like to write command script to check whether the servers could RDP or not.
we have around 30 servers hence cant run mstsc /v:servername for each. Hence just would like to write cmd script to check all the servers. Could you please help me ?

can you please assist me with the system to enable remote access desktop/working into the network user without being there physically,i have i.p address and computer name of the workstation and we are all in one network.

Possibly you only have Windows Home Edition, which doesn’t support Remote Connections.

Remote Desktop Assistance is a feature of Windows Pro Editions.

can user able to see the desktop in mstsc command

It is not mstsc/console anymore. Now it is mstsc/admin. You can also add it to a desktop shortcut by changing the Target to %windir%\system32\mstsc.exe -admin

“admin” is different than “console” actually. Admin allows you to boot another user. My bad.

Hello..is there any option to trigger MSTC on windows boot up, preferably with pre-specified destination server and credentials?

Also, if the user logs out of the terminal server, he should get logged out of the local desktop as well.

I don’t want to give the user the option of a local desktop.

Command Line Parameters for Remote Desktop Connections in Windows 10

The Remote Desktop Connection (RSD) feature has been active in the Windows operating system since Windows NT Server 4.0; though as a Terminal Server. Come the Windows 10, RSD now exists as an inbuilt standalone app that can be accessed from not only Windows 10 computers but from major mobile and computer OS like Android, iOS, Linux, and Mac. RSD has been used by many companies and firms to control and operate computers in its network remotely. It is also essential for solving problems on devices you can’t access physically.

What is a Remote Desktop Connection?

Remote Desktop Connection (RSD), which is often shortened to Remote Desktop, is a feature created by Microsoft that allows a local computer to control a remote PC after connecting to it over the internet or a network.

Simply put, Remote Desktop Connection is the ability to connect and use another computer from your computer.

Before we proceed note, any edition of Windows can act as a Remote Desktop Client. But to host a remote season, you need a PC running Windows 10 Pro or Enterprise.

We have already seen the different ways to enable Remote Desktop Connection in Windows 10. Today, we will take a look at some command-line options for using RDP. Instead of starting Remote Desktop Connection from the Start menu, Windows 10/8/7 allows you to start it from the search box, from the Run dialog box, or from a command line. With these methods, you can use additional command line parameters to control how Remote Desktop Connection looks or behaves.

Читайте также:  Команда создания пользователя windows

Command Line Parameters for Remote Desktop Connections

From the Run dialogue box or the Command Prompt, we can carry so many instructions easily. To see all the possible commands and a brief description you can access, copy and paste any of the commands below:

This is the syntax-

Continue reading to see a few descriptions:

  1. Whenever you connect to the server, Windows opens a new user session. You can avoid this by opening a connection to the console. Add /console to the mstsc

mstsc /console

  1. To open remote desktop session in full screen, run the command below (/f);

mstsc /f

  1. To specify the remote computer name from the command, use the command below (/v);

Brief description of the Syntax above

«connection file» – Specifies the name of an .RDP file for the connection.

/v: – Specifies the remote PC to which you want to connect.

/g: – Specifies the RD Gateway server to use for the connection. This parameter is only read if the endpoint remote PC is specified with /v.

/admin – Connects you to the session for administering a remote PC.

In this version of Remote Desktop Connection, if the Remote Desktop Session Host role service is installed on the remote computer, running mstsc /admin will do the following (for the current connection only):

  • Disable Remote Desktop Services client access licensing
  • Disable time zone redirection
  • Disable RD Connection Broker redirection
  • Disable Remote Desktop Easy Print
  • Disables Plug and Play device redirection for this connection only.
  • Changes the remote session theme to Windows Classic View (if it’s available) for this connection only.

/f – Starts Remote Desktop in full-screen mode.

/w: – Specifies the width of the Remote Desktop window.

/h: – Specifies the height of the Remote Desktop window.

/public – Runs Remote Desktop in public mode.

/span – Matches the remote desktop width and height with the local virtual desktop, spanning across multiple monitors, if necessary. To span across monitors, the monitors must be arranged to form a rectangle.

/multimon – Configures the Remote Desktop Services session monitor layout to be identical to the current client-side configuration.

/edit – Opens the specified .RDP connection file for editing.

With the Remote Desktop Connection, you have access to only computers in your network. You can use only one remote desktop connection on Windows 10 at a time, i.e., one remote user per Windows.

However, a PC running Windows 10 server edition can run remote Sessions for different users at the same time.

Date: September 5, 2020 Tags: Remote Desktop

Cannot Copy Paste in Remote Desktop Session in Windows 10

Remote desktop can’t connect to the remote computer in Windows 10

How to troubleshoot general Remote Desktop connection issues on Windows 10

[email protected]

Keshi Ile is a Windows enthusiast who loves to write How-to’s, Gadget & software reviews, and tech tutorials. He has also managed SEO teams that grew businesses from zero traffic to authority status.

Подключение к удаленному рабочему столу в Windows с помощью приложения mstsc.exe

Содержание

Содержание

Обычный пользователь ПК или ноутбука на базе Windows 10 использует свое устройство обыденно: садится, включает и начинает напрямую работать на устройстве. Но есть, скажем так, нетрадиционный вариант, который редко применяется пользователями — удаленное подключение через настройку RDP на Windows 10.

Метод имеет определенные достоинства:

  • не нужно тратить время на проезд, находясь вдалеке от рабочего места;
  • удаленное решение проблем с устройством компетентным специалистом;
  • возможность работы со слабого устройства на более мощном;
  • предоставляет возможность работы в полном доступе к удаленному ПК.

Но имеются и недостатки:

  • ограничение на количество одновременных RDP-сессий;
  • подключение через RDP только к старшим редакциям Windows (Pro и выше);
  • если пользователь работает на своем ПК без удаленного доступа, то RDP будет отключен;
  • подключение через RDP осуществляется только на один ПК.

Удаленные пользователи могут подключаться к своим компьютерам Windows 10 через службу удаленных рабочих столов (RDP) в редакциях Pro и Enterprise, но не в домашних Home/Single Language. Но есть ограничение на количество одновременных RDP-сессии — допускается одновременная работа только одного удаленного пользователя. Если вы попробуете открыть вторую RDP-сессию, появится предупреждение с запросом отключить сеанс первого пользователя.

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

Что такое RPD и MSTSC

RDP — (англ. Remote Desktop Protocol — протокол удалённого рабочего стола) — проприетарный протокол прикладного уровня. Официальное название Майкрософт для клиентского ПО — Remote Desktop Connection или Terminal Services Client (TSC), для версий Windows просто MSTSC.

В свою очередь MSTSC расшифровывается как клиент служб терминалов Windows. Мы будем использовать в данном обзоре утилиту mstsc.exe — стандартное программное обеспечение современных ОС семейства Windows, предназначенное для подключения к удаленным рабочим столам с использованием протокола RDP.

Читайте также:  Каталог обновления для windows server 2012 r2

Как настроить

Подключение происходит в несколько этапов:

  • определение возможностей вашего издания Windows 10;
  • корректировка настроек Windows;
  • настройка и управление IP;
  • настройка порта RDP.

Прежде всего надо убедиться, что ваша Windows 10 как минимум Pro-версии, так как компоненты и сервис для RDP-сервера, которые делают возможным удаленное подключение заблокированы.

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

В разделе параметров Windows выбираем учетные записи — варианты входа — пароль — изменить.

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

Первое, что входит в корректировку настроек Windows, — включение доступа и добавление пользователей. Чтобы сделать Интернет-соединение с использованием RDP, откройте Пуск и нажмите на шестеренку «Параметры».

Открываем раздел с настройкой системы.

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

Если в системе имеется автоматический «спящий режим», то будет показано предупреждение.

Решается данная проблема в схемах настройках схем электропитания.

В пункте «Переводить компьютер в спящий режим режим» выбираем: «Никогда», если вы хотите, чтобы удаленный ПК был постоянно доступен.

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

Если вы решили воспользоваться максимальной производительностью, но не нашли эту схему в настройках, тогда ее придется добавить вручную через командную строку, поскольку Microsoft в новых ревизиях (выше 1703) больше не встраивает данные схемы «дефолту».

В cвойствах системы в подразделе удаленного доступа разрешите удаленные подключения к компьютеру.

При желании можно провести настройку для нескольких пользователей, нажав кнопку «Выбрать пользователей».

По умолчанию доступ дается администраторам, но можно добавить другого пользователя (к примеру, специально созданного для этих задач).

Вписываем его имя в системе.

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

Затем в «Типы объектов» выберите «Пользователи» и нажмите поиск.

Вы получите небольшой список.

Пользователь появится в списке допуска к удаленному рабочему столу (RDP).

В зависимости от сборки ОС, порядок действий может несколько отличаться. Например, официальное руководство предлагает перейти к параметрам рабочего стола непосредственно в подразделе «Система» или же открыть в браузере адрес «ms-settings:remotedesktop», вводить нужно без кавычек.

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

Вместо имени компьютера часто используется IP. Чтобы его просмотреть нужно зайти в «Панель управления» и вызвать «Сеть и интернет».

Далее выбираем центр управления сетями и общего доступа.

Затем кликаем непосредственно по самому подключению.

В просмотре состояния нажмите Сведения.

Отобразится детальная информация, из которой нужно запомнить или записать IPv4.

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

Если у вашей сети есть администратор, проконсультируйтесь с ним о допустимости такой настройки. Впрочем, это относится и к разрешению удаленного доступа в целом.

В окне просмотра состояния перейдите к свойствам. Далее выберите протокол IPv4 и откройте детальный просмотр.

В качестве адреса укажите значение, которое не попадает в используемый для динамического использования диапазон. Соответствующую настройку можно опять-таки найти в роутере.

Традиционно маска указывается в виде 255.255.255.0, так что IP должен отличаться от адреса шлюза (его не меняем) только последним числом.

В качестве DNS можно указать используемые в вашей сети значения или же воспользоваться публичными сервисами: 8.8.8.8 от Google, 1.1.1.1 от Cloudflare и так далее.

Настройка порта RDP

Приступаем к непосредственной настройке порта RDP для удаленного доступа.

Если система, которой выполняется RDP-подключение, находится за роутером, то может потребоваться настройка порта. Для этого стандартным образом подключитесь к роутеру через веб-интерфейс (используемый для этого адрес необходимо уточнить в инструкции к оборудованию). Далее найдите в настройках раздел Port Forwarding (перенаправление портов). Потребуется добавить в него правило со следующими параметрами:

  • название может быть произвольным;
  • в качестве порта выберите 3389 TCP;
  • IP введите от своего ПК;
  • локальный порт также пропишите 3389;
  • выберите протокол TCP из списка.

После этого можно подключаться удаленно и работать с ПК.

Подключение к удаленному рабочему столу в Windows 10

После настройки для подключения в режиме RDP можно использовать стандартную программу.

Минимальные требования для соединения — указать имя или IP компьютера, с которым вы хотите работать.

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

Если показывается уведомление об отсутствии сертификата, его допустимо проигнорировать (вы же уверены в своем ПК, верно?).

Также в окне подключения можно раскрыть детальные параметры подключения:

дополнительно в данной вкладке можно отключить проверку сертификата.

В отличие от настройки RDP на Windows 10 Server, здесь одновременно может работать только один пользователь. Независимо от того, прямо за компьютером или удаленно. Так что, если попробуете подключиться к системе, куда уже кто-то вошел, появится предупреждение. Можно или отключить активного пользователя, или самому подключиться позже.

Если вам нужно настроить RDP с одновременной работой, переходите на серверные ОС, такие как Windows Server 2012 r2/2016.

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

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

Чтобы полностью выйти в меню Пуск удаленной машины выберите «Отключиться».

Оцените статью
Adblock
detector