Microsoft Remote Desktop Command Line

  1. Microsoft Remote Desktop Command Line Download
  2. Windows Remote Desktop Command Line Username Password
  3. Microsoft Remote Desktop Connection Manager Command Line

There will be times as a Windows Administrator that you will need to reboot or shutdown a remote computer or server.

In this tutorial, I’ll show you two easy methods for rebooting and shutting down remote computers.

Enable Remote Desktop using Command line. To enable Remote Desktop using Command Prompt and Windows PowerShell, follow these steps. Open Command Prompt or PowerShell with administrator privilege. Configuring Remote Desktop Connection from the Command Line. To use the RDC client from the command line or custom shortcut, type mstsc followed by the appropriate command-line switches. For example, to initiate a Remote Desktop session using a custom display resolution of 1680 x 1050, type mstsc /w:1680 /h:1050 at a command prompt. Acquire access to the Windows command line (cmd.exe). This can be done by pressing the Windows key and the r key on the keyboard, then by typing. And pressing enter. Next, type the following: mstsc /console /V:address. This will start a Remote Desktop Protocol connection to the console session of the remote machine.

The first method uses a built in Windows command and the second method uses PowerShell.

Check it out.

Windows Shutdown Command

Windows systems has a built in shutdown command that can be used to restart or shutdown local and remote computers.

The command is shutdown.

To use this command just open the windows command prompt and type shutdown.

To view the full list of command options type shutdown /? in the CMD window.

There are several command line switches, below I list the most useful options.

Desktop

/s – Shutdown the computer

/r – restart computer

/m computer – Specify the remote computer

/l – Log off

/t xxx – Set the time out period before shutdown to xxx seconds

/c “comment” – Message to display on the screen before restart or shutdown

Now lets move onto some examples

Restart or Shutdown Examples with Command Line

Microsoft Remote Desktop Command Line Download

In these examples, I’ll be on PC1 and will initiate a remote restart or shutdown on PC2.

I’ll be using the /r switch in these examples, you can change them to /s to shutdown instead of restart.

Example 1: Restart Remote Computer

By default, this will prompt the remote computer and give it about a minute before it restarts.

The pop up below is what a Windows 10 system will display.

Example 2: Restart With a Custom Message

You may want to display a custom message to the logged on users, to do that just use the /c command.

Microsoft Remote Desktop Command Line

Below is the pop up on the remote computer with the custom message.

Example 3: Immediate Restart no Countdown

If you want to immediately restart with no countdown or message use this command.

If you want a longer countdown just specify the seconds /t 60

Example 4: Log user off remote computer

If you just want to log a user off the remote computer use this command.

Restart or Shutdown with Powershell

Here are a few examples of how you can restart or shutdown computers with PowerShell.

The downside to PowerShell is it doesn’t have as many options as the shutdown command. There is no option to prompt users with a custom message or provide a countdown.

Example 1: Use Powershell to restart a computer

This command will immediately restart a remote computer. The -Force option will force a restart even if a user is logged on.

Example 2: Use PowerShell to shutdown a computer

This command will shutdown a remote computer. Use the -Force to force a shutdown even if a user is logged on.

Example 3: Use PowerShell to restart a list of computers

Desktop

Windows Remote Desktop Command Line Username Password

Desktop

This is handy if you have several computers to restart. Just list all the computers you want in a text file and add that to the PowerShell command.

Example 4: Use PowerShell to shutdown down two computers

Have fun!

Used by thousands of Professionals to Simplify and Automate Active Directory Management.

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:

Microsoft Remote Desktop Connection Manager Command Line

Relevant Posts:
Run command for Remote Desktop
Remote desktop and Terminal Services : Frequently asked questions

Comments are closed.