Video and Lab - Enable remote desktop using PowerShell

Microsoft Windows Server 2016: Hands-on Training - Part I Speed Learning ....Server 2016 Administration
9 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€96.21
List Price:  €134.70
You save:  €38.49
£79.77
List Price:  £111.68
You save:  £31.91
CA$143.95
List Price:  CA$201.54
You save:  CA$57.58
A$160.33
List Price:  A$224.47
You save:  A$64.14
S$135.93
List Price:  S$190.31
You save:  S$54.37
HK$776.63
List Price:  HK$1,087.32
You save:  HK$310.68
CHF 90.06
List Price:  CHF 126.09
You save:  CHF 36.02
NOK kr1,139.30
List Price:  NOK kr1,595.07
You save:  NOK kr455.76
DKK kr717.87
List Price:  DKK kr1,005.05
You save:  DKK kr287.17
NZ$177.29
List Price:  NZ$248.21
You save:  NZ$70.92
د.إ367.26
List Price:  د.إ514.17
You save:  د.إ146.91
৳11,945.58
List Price:  ৳16,724.30
You save:  ৳4,778.71
₹8,518.63
List Price:  ₹11,926.43
You save:  ₹3,407.79
RM448.65
List Price:  RM628.13
You save:  RM179.48
₦154,771.52
List Price:  ₦216,686.32
You save:  ₦61,914.80
₨27,852.21
List Price:  ₨38,994.21
You save:  ₨11,141.99
฿3,415.60
List Price:  ฿4,781.97
You save:  ฿1,366.37
₺3,525.07
List Price:  ₺4,935.24
You save:  ₺1,410.17
B$620.23
List Price:  B$868.35
You save:  B$248.12
R1,852.48
List Price:  R2,593.54
You save:  R741.06
Лв188.12
List Price:  Лв263.38
You save:  Лв75.25
₩146,004.73
List Price:  ₩204,412.46
You save:  ₩58,407.73
₪366.53
List Price:  ₪513.16
You save:  ₪146.62
₱5,844.26
List Price:  ₱8,182.20
You save:  ₱2,337.93
¥15,707.80
List Price:  ¥21,991.55
You save:  ¥6,283.75
MX$2,012.91
List Price:  MX$2,818.16
You save:  MX$805.24
QR364.43
List Price:  QR510.22
You save:  QR145.78
P1,382.66
List Price:  P1,935.78
You save:  P553.12
KSh12,923.70
List Price:  KSh18,093.70
You save:  KSh5,170
E£5,089.49
List Price:  E£7,125.49
You save:  E£2,036
ብር12,725.10
List Price:  ብር17,815.66
You save:  ብር5,090.55
Kz91,190.88
List Price:  Kz127,670.88
You save:  Kz36,480
CLP$99,038.09
List Price:  CLP$138,657.29
You save:  CLP$39,619.20
CN¥729.75
List Price:  CN¥1,021.68
You save:  CN¥291.93
RD$6,065.06
List Price:  RD$8,491.33
You save:  RD$2,426.27
DA13,522.10
List Price:  DA18,931.49
You save:  DA5,409.38
FJ$232
List Price:  FJ$324.81
You save:  FJ$92.81
Q770.19
List Price:  Q1,078.30
You save:  Q308.10
GY$20,913.42
List Price:  GY$29,279.63
You save:  GY$8,366.20
ISK kr13,961.60
List Price:  ISK kr19,546.80
You save:  ISK kr5,585.20
DH1,005.73
List Price:  DH1,408.06
You save:  DH402.33
L1,844.84
List Price:  L2,582.85
You save:  L738.01
ден5,920.21
List Price:  ден8,288.54
You save:  ден2,368.32
MOP$800
List Price:  MOP$1,120.03
You save:  MOP$320.03
N$1,842.15
List Price:  N$2,579.09
You save:  N$736.93
C$3,678.44
List Price:  C$5,149.97
You save:  C$1,471.52
रु13,621.60
List Price:  रु19,070.79
You save:  रु5,449.18
S/372.86
List Price:  S/522.02
You save:  S/149.15
K405.52
List Price:  K567.74
You save:  K162.22
SAR375.60
List Price:  SAR525.86
You save:  SAR150.25
ZK2,766.47
List Price:  ZK3,873.18
You save:  ZK1,106.70
L478.77
List Price:  L670.30
You save:  L191.52
Kč2,420.15
List Price:  Kč3,388.31
You save:  Kč968.16
Ft39,675.18
List Price:  Ft55,546.85
You save:  Ft15,871.66
SEK kr1,106.30
List Price:  SEK kr1,548.87
You save:  SEK kr442.56
ARS$102,565.23
List Price:  ARS$143,595.42
You save:  ARS$41,030.19
Bs692.24
List Price:  Bs969.16
You save:  Bs276.92
COP$438,826.54
List Price:  COP$614,374.71
You save:  COP$175,548.17
₡50,760.09
List Price:  ₡71,066.16
You save:  ₡20,306.06
L2,539.15
List Price:  L3,554.92
You save:  L1,015.76
₲780,390.60
List Price:  ₲1,092,578.06
You save:  ₲312,187.46
$U4,451.49
List Price:  $U6,232.27
You save:  $U1,780.77
zł411.19
List Price:  zł575.68
You save:  zł164.49
Already have an account? Log In

Transcript

Greetings, I'm Professor Kay. And in this short video presentation, we're going to see how we go about enabling Remote Desktop using PowerShell. For this video presentation, we'll be using one virtual install of server 2012 or 2016 configured as the domain controller, one virtual installer Server Core 2012 or 2016 joined to the domain, one virtual install of Windows 10 join to the domain. Remote Desktop or RDP allows us to have remote access to a machine as if we were sitting physically in front of it. With RDP we can be anywhere in the building. We can be on the highway between two jobs.

We can be in a remote hotel or we can be at home And we can still get access to our servers and our client machines using remote desktop. Before we get into the PowerShell portion of this lab, I wanted to show you how we can enable RDP using the GUI. There are a number of different ways that we can enable Remote Desktop on this machine other than using PowerShell. But for this demonstration, I'm going to use the command prompt. To start we're just going to go to search, we're going to type in cmd. And that brings up the command prompt.

Now once I have the command prompt up, I'm just going to type in or copy and paste in this case, System Properties, remote dot e xe, I'm going to go ahead and hit enter. That brings up the System Properties dialog box for enabling RDP. The default is not to allow remote connections to this computer. So we're going to select the radio button that will allow remote connections to this computer. If we would like to add other users other than the administrators To have access to this machine remotely using RDP, we can click on a select users button. And for this demonstration, I'll add the interns group.

And I'll check names. I'll say OK. And now the interns are members of the remote desktop users. I'll click OK. And then I'll click Apply. Click OK. And now RDP is enabled on this machine. For this next demonstration, we're going to see how we use PowerShell. To enable RDP on this particular server.

To get started, we're going to go to the start button. And from the tile menu, we're going to select Windows PowerShell. Right click, and we're going to say run as administrator. I've gone full screen and I have increased the font size, so that you can better see what's going on with these PowerShell commands. So I've copied and pasted the first command into my PowerShell. Now it's pretty long command, but let's take a look at it.

So it tells you that it's going to Go up, and it's going to set the registry key with the value of zero. And this is going to enable or turn on Remote Desktop protocol on this machine. So let's go ahead and just hit Enter. And it comes back to the prompt letting us know that the command completed successfully. This next command is going to make an exception through our firewall. And it's going to allow RDP from a remote user to come into this machine.

So it's going to set the firewall for remote desktop users and allow TCP in and it's going to enable it by setting that particular variable on the firewall to true. Let's go ahead and hit Enter. And we're back to the prompt let us know that the command completed successfully. This third and last command is going to require that RDP must use authentication to communicate to this device. Go ahead and hit enter or back to the person Let us know that the command completed successfully. So now that we have RDP enabled on our domain controller, we need to test it.

And to do this, I'm going to use my windows 10 client, I'm going to go to the start button here. And in the search, I'm going to type in remote. And at the very top, I'm going to select Remote Desktop Connection. Now there's a couple of different ways you can do this. You can type in the actual name of the server if you have a reverse lookup zone configured for your DNS, or you can type in the IP address. So I'm going to go ahead and type in the name of my domain controller.

And now I'm going to go ahead and connect. And it's going to pop up and it's going to ask you for your administrator password. Once you have your password typed in, just click on the OK button. And now it's going to attempt to connect. And we're now looking at the desktop of my domain controller, my DC one, and this is right where we left it. We're now enabling RDP on my a domain controller and I'll be able to get to it anywhere inside the building, as long as I have access to a machine that is connected to the network.

So just connect, we're just going to go to the start button, we're going to click on the power button. And now you'll see a new option that says disconnect. We're going to go ahead and use that. And that's going to kill my session bring us right back to my Windows 10 desktop. In this next demonstration, you're going to see how we go about enabling Remote Desktop on a remote server using Server Manager on my primary domain controller. So to begin this process, we're going to click on the start button.

And now we're going to click on Server Manager. To use Server Manager to enable RDP on a remote machine, I have to add that server to the all servers group up here inside of Server Manager. So we're going to click on all servers. I'm going to right click and I'm going to select the option to add servers. here where it says name I'm going to type in the name of the server when the server hasn't been found, it goes down to the bottom window, I highlight it, and then I select the arrow to move it over to the window on the right. And I'm going to click OK. machine has now been added to Server Manager and I will now be able to manage it remotely.

Again, I'm going to want to use PowerShell onto this Server Core installation, but I want to do it from here inside of Server Manager on my DC one. To do this, I'm just going to go to the name of the machine, right click, and I'm going to select Windows PowerShell. Now you'll see that I have a PowerShell session going on with my Server Core remotely using my Server Manager. So the first thing we want to do is enable Remote Desktop. So I'm just going to go ahead and insert that first command again. And now I'm going to hit enter comes back to the prompt letting me know that the command completed successfully and just as we did on my first server I'm going to have to make an exception in the firewall to allow Remote Desktop.

So I'm going to type in that second command into the prop. And then I'm going to hit Enter, and it comes back to the prompt letting me know that the command completed successfully. This third and last command will require that RDP use authentication to communicate with this installation of Server Core. So again, I'm going to go ahead and hit Enter, and it comes back to the prompt letting me know that that command completed successfully, we can now close out the PowerShell session. Now I'm back over on my windows 10 machine. And I'm going to want to test to see if RDP is actually working on my installation and Server Core.

So to do this again, I'm going to go to start up here in the search, I'm going to type in remote, and from the top I'm going to go ahead and select Remote Desktop Connection. Now there's two ways that we can do this. I can use the name of the machine or I can type in the IP address if the name of the machine does that Not work, use the IP address of the machine. And it comes back and says it can't find the computer. Not happens, just attempt to connect one more time. And if it fails, again, this time, use the IP address.

So I'm gonna type in my administrator password for the domain. I'm going to hit enter. So you Okay, it can take it a few seconds to negotiate. That's what it's doing right now it's trying to figure out how you can get over here and now we're connected. So you can see that I have the command prompt that is currently up and running on my Server Core. And now I am connected to my installation Server Core as if I was physically sitting in front of it.

Administrators are allowed to free terminal service license that they can use for remote desktop. Now, it's important that you remember to disconnect gracefully from each one of these sessions. Because if you don't, you're going to leave the session open and that license will not be put back into the pool. We're up inside his Server Core and we don't have a shutdown button where we can get an option to disconnect. So for this, we're going to have to use the terminal service command log off. So at the prompt, I just type in log off, and it disconnects me.

Now I'm back to my Windows 10 desktop. In this short video presentation, you got to see how we go about enabling Remote Desktop on a server using one of three methods. That's going to conclude this short video presentation on how we go about enabling Remote Desktop on a machine using PowerShell. Now if you have any questions or concerns about anything that was covered in this video or in the lab, please don't hesitate to reach out and contact your instructor and I'll see you in my next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.