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
€92.81
List Price:  €129.94
You save:  €37.13
£79.68
List Price:  £111.56
You save:  £31.87
CA$136.70
List Price:  CA$191.38
You save:  CA$54.68
A$151.47
List Price:  A$212.07
You save:  A$60.59
S$134.88
List Price:  S$188.84
You save:  S$53.96
HK$781.18
List Price:  HK$1,093.68
You save:  HK$312.50
CHF 90.49
List Price:  CHF 126.69
You save:  CHF 36.20
NOK kr1,087.35
List Price:  NOK kr1,522.33
You save:  NOK kr434.98
DKK kr692.92
List Price:  DKK kr970.11
You save:  DKK kr277.19
NZ$166.33
List Price:  NZ$232.87
You save:  NZ$66.53
د.إ367.25
List Price:  د.إ514.16
You save:  د.إ146.91
৳10,943.35
List Price:  ৳15,321.13
You save:  ৳4,377.77
₹8,337.18
List Price:  ₹11,672.39
You save:  ₹3,335.20
RM473.95
List Price:  RM663.55
You save:  RM189.60
₦123,487.65
List Price:  ₦172,887.65
You save:  ₦49,400
₨27,738.77
List Price:  ₨38,835.40
You save:  ₨11,096.62
฿3,675.50
List Price:  ฿5,145.85
You save:  ฿1,470.34
₺3,235.04
List Price:  ₺4,529.19
You save:  ₺1,294.14
B$509.60
List Price:  B$713.47
You save:  B$203.86
R1,850.72
List Price:  R2,591.08
You save:  R740.36
Лв181.51
List Price:  Лв254.13
You save:  Лв72.61
₩135,590.93
List Price:  ₩189,832.73
You save:  ₩54,241.80
₪370.74
List Price:  ₪519.05
You save:  ₪148.31
₱5,705.78
List Price:  ₱7,988.32
You save:  ₱2,282.54
¥15,303.96
List Price:  ¥21,426.16
You save:  ¥6,122.20
MX$1,697.07
List Price:  MX$2,375.96
You save:  MX$678.89
QR363.69
List Price:  QR509.19
You save:  QR145.49
P1,358.38
List Price:  P1,901.79
You save:  P543.40
KSh13,211.65
List Price:  KSh18,496.84
You save:  KSh5,285.18
E£4,788.95
List Price:  E£6,704.73
You save:  E£1,915.77
ብር5,723.72
List Price:  ብር8,013.44
You save:  ብር2,289.71
Kz83,591.64
List Price:  Kz117,031.64
You save:  Kz33,440
CLP$94,219
List Price:  CLP$131,910.38
You save:  CLP$37,691.37
CN¥723.64
List Price:  CN¥1,013.13
You save:  CN¥289.48
RD$5,794.19
List Price:  RD$8,112.10
You save:  RD$2,317.90
DA13,457.95
List Price:  DA18,841.67
You save:  DA5,383.72
FJ$225.30
List Price:  FJ$315.43
You save:  FJ$90.13
Q775.06
List Price:  Q1,085.12
You save:  Q310.05
GY$20,860.22
List Price:  GY$29,205.14
You save:  GY$8,344.92
ISK kr13,949.49
List Price:  ISK kr19,529.85
You save:  ISK kr5,580.35
DH1,005.73
List Price:  DH1,408.07
You save:  DH402.33
L1,766.28
List Price:  L2,472.87
You save:  L706.58
ден5,712.52
List Price:  ден7,997.75
You save:  ден2,285.23
MOP$802.57
List Price:  MOP$1,123.63
You save:  MOP$321.06
N$1,845.78
List Price:  N$2,584.16
You save:  N$738.38
C$3,670.67
List Price:  C$5,139.09
You save:  C$1,468.41
रु13,313.56
List Price:  रु18,639.52
You save:  रु5,325.95
S/372.22
List Price:  S/521.13
You save:  S/148.90
K385.44
List Price:  K539.63
You save:  K154.19
SAR375.02
List Price:  SAR525.04
You save:  SAR150.02
ZK2,689.66
List Price:  ZK3,765.63
You save:  ZK1,075.97
L462.03
List Price:  L646.86
You save:  L184.83
Kč2,326.92
List Price:  Kč3,257.79
You save:  Kč930.86
Ft36,152.68
List Price:  Ft50,615.20
You save:  Ft14,462.51
SEK kr1,078.64
List Price:  SEK kr1,510.15
You save:  SEK kr431.50
ARS$87,815.44
List Price:  ARS$122,945.14
You save:  ARS$35,129.69
Bs690.51
List Price:  Bs966.74
You save:  Bs276.23
COP$388,367.89
List Price:  COP$543,730.59
You save:  COP$155,362.69
₡50,962.55
List Price:  ₡71,349.61
You save:  ₡20,387.06
L2,463.20
List Price:  L3,448.58
You save:  L985.38
₲746,475.93
List Price:  ₲1,045,096.16
You save:  ₲298,620.23
$U3,821.56
List Price:  $U5,350.33
You save:  $U1,528.77
zł401.98
List Price:  zł562.79
You save:  zł160.80
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.