Remote Desktop Services: RDP, RemoteApps and remote access

Admins spend their day in Remote Desktop getting onto servers, and plenty of companies hand staff their apps the same way so they can work from anywhere. Remote Desktop Services (RDS) turns a server into a shared desktop or app host, complete with a web portal, load balancing and licensing.

First you’ll check how RDP is secured on SRV01. Then you’ll build a small RDS deployment on SRV01 with a session collection and a RemoteApp, open the app from CL01 through RD Web Access, and finish with a look at RD Gateway, VPN and NPS for people working from outside.

TimeYou needBy the end you can
About 75 minutesDC01, SRV01 and CL01 from Lesson 25Secure RDP with NLA and groups, deploy RDS roles with PowerShell, publish RemoteApps, explain RD Gateway, VPN and NPS, and fix common connection errors

What it is, in one line

Remote Desktop Services is the Windows Server role set that lets many users run desktops or individual apps on a server over the RDP protocol, from their own devices.

In Simple Words

A shared office kitchen

Rather than buying every employee their own coffee machine, a company puts a few good ones in a shared kitchen that everyone uses and one person keeps clean and stocked. An RDS server is that shared kitchen for apps: the apps are installed once on the server, people use them from any laptop (even an old one), and updates happen in one place. The front desk that decides who gets in (RD Web Access and the Connection Broker) and the badge reader at the building door (RD Gateway) keep it organised and safe.

Engineer's View

RDP, RDS roles, licensing, remote access

RDP runs on TCP and UDP 3389. With Network Level Authentication (NLA), users have to authenticate before a session is created, which saves server resources and stops a lot of attacks. Who can connect is controlled by the Remote Desktop Users group (or, in RDS, the collection’s user groups) together with the “Allow log on through Remote Desktop Services” right.

RDS roles: RD Session Host runs the sessions; RD Connection Broker balances users across hosts and reconnects them to existing sessions; RD Web Access publishes apps on a web page (/RDWeb); RD Gateway wraps RDP in HTTPS (443) for outside users; RD Licensing issues client access licences (CALs), after a 120-day grace period.

Collections and RemoteApps: a session collection is a group of session hosts that share the same settings and users, and a RemoteApp shows one app in its own window instead of a whole desktop.

Other remote access: RRAS gives you VPN (SSTP, IKEv2) and routing, and NPS is Microsoft’s RADIUS server, which VPNs, Wi-Fi and RD Gateway use to check who’s allowed to connect. Putting 3389 straight onto the internet is never acceptable.

How it works, step by step

Here’s how a user outside the office reaches an app on the session host:

Remote Desktop Services path: RD Gateway, Connection Broker and Session Host

Only RD Gateway faces the internet, over HTTPS. Inside the network the Connection Broker picks a session host and the Gateway passes RDP on to it. In the lab everything sits on SRV01 and CL01 connects from inside, so you’ll skip the Gateway.

Here’s the RDS deployment you’ll build:

Remote Desktop Services lab roles: Connection Broker, Web Access, Session Host and licensing
  1. Check RDP on SRV01: enabled, NLA on, firewall rules, who may connect.
  2. Deploy RD Connection Broker, RD Web Access and RD Session Host on SRV01 in one command.
  3. Create the Office collection for Domain Users.
  4. Publish Notepad as a RemoteApp.
  5. Open it from CL01 through RD Web Access and see the session from the server.

In production these roles sit on separate servers, with at least two session hosts, and licensing is set up before the 120-day grace period runs out.

Hands-on Lab: Remote Desktop Services on SRV01

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

Start DC01, SRV01 and CL01 and take a “Before RDS” snapshot of SRV01 first. Then sign in to SRV01 as SAATLAB\Administrator and work in PowerShell as administrator.

1Check how RDP is set up on SRV01

On SRV01, run this:

(Get-ItemProperty 'HKLM:\System\CurrentControlSet\Control\Terminal Server').fDenyTSConnections
(Get-CimInstance -Namespace root\cimv2\TerminalServices -ClassName Win32_TSGeneralSetting -Filter "TerminalName='RDP-Tcp'").UserAuthenticationRequired
Get-NetFirewallRule -DisplayGroup 'Remote Desktop' | Select-Object DisplayName, Enabled
Get-LocalGroupMember 'Remote Desktop Users'

You should see something like this:

0
1

DisplayName                             Enabled
-----------                             -------
Remote Desktop - User Mode (TCP-In)        True
Remote Desktop - User Mode (UDP-In)        True
Remote Desktop - Shadow (TCP-In)           True

fDenyTSConnections 0 means RDP is on (you turned it on in Lesson 6), and UserAuthenticationRequired 1 means NLA is required. Remote Desktop Users is empty, so right now only administrators can connect, which is where you want a server to start.

✅ Checkpoint: RDP is on, NLA is required and only admins can connect to SRV01.

2Deploy the RDS roles

Run this on SRV01, and expect SRV01 to restart during the deployment:

Import-Module RemoteDesktop
New-RDSessionDeployment -ConnectionBroker SRV01.saatlab.internal -WebAccessServer SRV01.saatlab.internal -SessionHost SRV01.saatlab.internal

The command installs the three roles, restarts SRV01 and finishes the setup once it’s back, which can take 10 minutes. When it’s up again, sign in as SAATLAB\Administrator.

Then check the deployment:

Get-RDServer -ConnectionBroker SRV01.saatlab.internal | Select-Object Server, Roles

You should see something like this:

Server                 Roles
------                 -----
SRV01.saatlab.internal {RDS-CONNECTION-BROKER, RDS-WEB-ACCESS, RDS-RD-SERVER}

✅ Checkpoint: Get-RDServer lists SRV01 with the Connection Broker, Web Access and Session Host roles.

3Create a session collection

On SRV01, run this:

New-RDSessionCollection -CollectionName Office -SessionHost SRV01.saatlab.internal -ConnectionBroker SRV01.saatlab.internal -CollectionDescription 'Lab apps for staff'
Set-RDSessionCollectionConfiguration -CollectionName Office -UserGroup 'SAATLAB\Domain Users' -ConnectionBroker SRV01.saatlab.internal
Get-RDSessionCollectionConfiguration -CollectionName Office -UserGroup -ConnectionBroker SRV01.saatlab.internal

You should see something like this:

CollectionName UserGroup
-------------- ---------
Office         {SAATLAB\Domain Users}

The collection’s user group decides who can connect to its session hosts. On a real farm you’d use a dedicated group such as GG_RDS_Office rather than all Domain Users.

✅ Checkpoint: The Office collection exists with SAATLAB\Domain Users as its user group.

4Publish Notepad as a RemoteApp

On SRV01, run this:

New-RDRemoteApp -CollectionName Office -DisplayName 'Notepad' -FilePath 'C:\Windows\System32\notepad.exe' -ConnectionBroker SRV01.saatlab.internal | Out-Null
Get-RDRemoteApp -CollectionName Office -ConnectionBroker SRV01.saatlab.internal | Select-Object DisplayName, FilePath, ShowInWebAccess

You should see something like this:

DisplayName FilePath                        ShowInWebAccess
----------- --------                        ---------------
Notepad     C:\Windows\System32\notepad.exe True

You can publish any program installed on the session host this way. At work it’s usually the line-of-business app that’s a pain to install on every laptop.

✅ Checkpoint: Notepad is published in the Office collection and shown in Web Access.

5Open the RemoteApp from CL01

On CL01, sign in as SAATLAB\priya.sharma and open https://srv01.saatlab.internal/RDWeb in Edge. The deployment uses a self-signed certificate, so for the lab accept the warning (Lesson 34 sorts this out).

Sign in as saatlab\priya.sharma, click Notepad, open the .rdp file that downloads and click Connect. Notepad opens in its own window, but it’s running on SRV01, and if you go to File, Save As you’ll see SRV01’s drives.

Now look at the session from SRV01:

Get-RDUserSession -ConnectionBroker SRV01.saatlab.internal | Select-Object UserName, HostServer, SessionState, CollectionName

You should see something like this:

UserName     HostServer             SessionState CollectionName
--------     ----------             ------------ --------------
priya.sharma SRV01.saatlab.internal STATE_ACTIVE Office

From here you can send the user a message, shadow their session with their permission or log them off, which is everyday work for session host admins.

✅ Checkpoint: Priya runs Notepad as a RemoteApp, and Get-RDUserSession shows her active session on SRV01.

Remote Desktop Services lab: Priya's active RemoteApp session on SRV01
The Connection Broker shows Priya’s RemoteApp session on SRV01 in the Office collection.

Close Notepad, then take a snapshot of SRV01 called “RDS”.

VBoxManage snapshot SRV01 take "RDS"

Break It, Then Fix It

Most RDS tickets come down to “I’m not allowed in” or “I can’t reach it at all”, and you’ll cause both.

1Break it: user not in the collection’s group

On SRV01, limit the Office collection to Finance:

Set-RDSessionCollectionConfiguration -CollectionName Office -UserGroup 'SAATLAB\GG_Finance' -ConnectionBroker SRV01.saatlab.internal

On CL01, sign in as SAATLAB\sneha.reddy (IT) and open https://srv01.saatlab.internal/RDWeb. After signing in, the page shows no apps at all. Then try a full desktop with mstsc /v:srv01.saatlab.internal.

You’ll get an error like this:

The connection was denied because the user account is not authorized for remote login.

Sneha’s password is fine and the server is up; the problem is that she isn’t in the group the collection allows. RD Web Access shows only the apps from collections you’re allowed to use, which is why her page is empty.

Fix it: allow the right groups again:

Set-RDSessionCollectionConfiguration -CollectionName Office -UserGroup 'SAATLAB\GG_Finance','SAATLAB\GG_IT' -ConnectionBroker SRV01.saatlab.internal

✅ Checkpoint: Sneha saw no apps and was denied while only GG_Finance was allowed, and sees Notepad after GG_IT was added.

2Break it: RDP blocked by the firewall

On SRV01, disable the Remote Desktop firewall rules:

Disable-NetFirewallRule -DisplayGroup 'Remote Desktop'

On CL01, test the port:

Test-NetConnection srv01.saatlab.internal -Port 3389 | Select-Object ComputerName, RemotePort, TcpTestSucceeded

You’ll see something like this:

WARNING: TCP connect to (10.0.0.20 : 3389) failed

ComputerName           RemotePort TcpTestSucceeded
------------           ---------- ----------------
srv01.saatlab.internal       3389            False

The RemoteApp now fails with “Remote Desktop can’t connect to the remote computer” and a list of possible reasons. You get the same message whether RDP is off, the server is down or a firewall is blocking it, so test the port first, because that tells you which one it is.

Fix it: enable the rules and test again:

Enable-NetFirewallRule -DisplayGroup 'Remote Desktop'      # on SRV01
Test-NetConnection srv01.saatlab.internal -Port 3389 | Select-Object TcpTestSucceeded   # on CL01

✅ Checkpoint: Port 3389 failed while the rules were disabled and succeeds after enabling them.

Remote Desktop Services lab: Test-NetConnection shows port 3389 blocked
Test the port first: if the TCP test on 3389 fails, look at the firewall before you look at the user.

This happened at work

Day 121

A small accounting firm set up two RDS session hosts so staff could work from home during tax season. It all worked, everyone was happy and the project was closed. Then, 120 days to the day after the deployment, in the busiest week of their year, every user got kicked off with “The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license.” Nobody had installed the RD Licensing role or bought CALs, so the grace period had run out. Getting the licences approved, buying them and activating the licence server took most of a day, and 40 accountants sat waiting.

The fix: they installed and activated RD Licensing, bought per-user CALs and set the licensing mode on the deployment. The project checklist now has “licensing configured and tested” as an item before sign-off.

The lesson: RDS runs fine out of the box for 120 days, and that hides the missing licensing, so set it up on day one rather than on day 121.

Common mistakes and troubleshooting

Mistake or symptomWhat happensWhat to do instead
RDP port 3389 open to the internetConstant brute-force and exploit attemptsRD Gateway or VPN with MFA; never expose 3389
NLA turned offSessions created before authentication; more attack surfaceKeep NLA required
“not authorized for remote login”User isn’t in Remote Desktop Users or the collection groupAdd the right group; check user rights GPOs
No RD Licensing after 120 daysAll users disconnectedInstall and activate licensing, set mode, buy CALs
Single session hostOne restart takes everyone offlineTwo or more hosts behind the Connection Broker
Self-signed RDS certificatesWarnings and trust promptsCertificates from your CA for all RDS roles
Admins installing apps in user sessionsApps install for one user onlyUse install mode (change user /install) or deploy properly
“Remote Desktop can’t connect” without testingGuessing between down, off and blockedTest-NetConnection to 3389 first
Profiles growing without limitsSlow sign-ins and full disksFSLogix or Folder Redirection with quotas

Interview questions

Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.

Fresher level

1. When you open Remote Desktop settings, there’s a checkbox for NLA. What is it, and should you leave it on?

Why they ask this: They’re checking you know the basic RDP security setting and why it matters.

How you might answer: NLA is Network Level Authentication, which means users have to authenticate before the RDP session is even created. I’d leave it on, because it cuts the attack surface and the server doesn’t waste effort building sessions for people who can’t sign in.

2. The network team asks which ports to open for Remote Desktop. What would you tell them?

Why they ask this: They want to see that you know the basic ports, including the gateway option.

How you might answer: Plain RDP uses TCP and UDP 3389, but if we go through RD Gateway, users connect over HTTPS on port 443 instead.

3. A developer who isn’t an admin needs to RDP to a test server. How would you give them access?

Why they ask this: They want to know whether you’ve done this before and whether you give only the access that’s needed.

How you might answer: I’d add them to the Remote Desktop Users group on that server, or better, add a group they’re already in. If it’s an RDS deployment, I’d use the collection’s user group instead. Then I’d make sure no Group Policy is denying them the logon right through Remote Desktop.

2–5 years experience

4. Walk me through the main RDS roles and what each one does.

Why they ask this: They want to see that you understand the RDS architecture and how the pieces fit together.

How you might answer: The Session Host runs the user sessions, and the Connection Broker balances the load and reconnects users to their existing sessions. Web Access publishes the apps and desktops, the Gateway tunnels RDP over HTTPS, and Licensing hands out the CALs.

5. Users suddenly can’t connect to a new RDS farm that was built about four months ago. What might have happened?

Why they ask this: They’re checking you know how RDS licensing works and what the grace period means.

How you might answer: My first guess would be that the grace period has ended, because after 120 days without a licence server handing out CALs, users can’t connect to the session hosts. I’d install RD Licensing, activate it, add the CALs and set the licensing mode on the deployment.

6. What is NPS, and where have you seen it used?

Why they ask this: They want to see you know this remote access piece and the kinds of connections it controls.

How you might answer: NPS, Network Policy Server, is Microsoft’s RADIUS server, and it authenticates and authorises connections using network policies. I’ve seen it used for VPN, Wi-Fi, switch port and RD Gateway connections.

Senior level

7. Your company suddenly needs 500 staff to work from home. How would you design remote access for them?

Why they ask this: They want to see that you think end to end, including security, capacity, profiles and alternatives.

How you might answer: I’d put RD Gateway with MFA in a DMZ or in Azure, with two or more Connection Brokers in HA, and size the session host farm by user load, with FSLogix profiles, proper licensing and monitoring. I’d also weigh up Azure Virtual Desktop as an alternative, and keep VPN for the people who need full network access.

8. Users say their RDS sessions feel slow, especially in the afternoon. What would you check?

Why they ask this: They want a structured way of troubleshooting that covers the host, the profiles and the network.

How you might answer: I’d look at CPU, memory and disk per session on the hosts and at how long profiles take to load, then at network latency and whether UDP is being used. After that I’d review graphics settings, antivirus exclusions and any app hogging resources, using performance counters and the RDS logs.

9. When would you give users a VPN, and when would you give them RD Gateway instead?

Why they ask this: They want to see that you understand the trade-offs in access, security and where the data lives.

How you might answer: VPN makes sense when users need lots of protocols and resources from their own device. If they only need apps or desktops I’d go with RD Gateway, because the data stays on the servers and the user’s device can reach far less of the network.

Quick quiz

Q1. What does NLA do?

  1. Speeds up RDP
  2. Requires authentication before a session is created
  3. Encrypts the disk
Show answer

B — It reduces attack surface.

Q2. Which RDS role publishes apps on a web page?

  1. RD Session Host
  2. RD Web Access
  3. RD Licensing
Show answer

B — The /RDWeb portal.

Q3. Why did Sneha see no apps in Break It step 1?

  1. Wrong password
  2. She wasn’t in the collection’s user group
  3. RDWeb was down
Show answer

B — The collection allowed only GG_Finance.

Q4. What should you test first when RDP “can’t connect”?

  1. Reinstall RDS
  2. TCP 3389 with Test-NetConnection
  3. Reset the password
Show answer

B — It shows whether the port is reachable.

Q5. In the work story, why were users disconnected?

  1. A virus
  2. The 120-day licensing grace period ended
  3. The gateway certificate expired
Show answer

B — Configure licensing on day one.

Quick recap

  • Remote Desktop Services hosts shared desktops and apps on session hosts.
  • Keep NLA on, control access with groups and never put 3389 on the internet.
  • Deploy roles with New-RDSessionDeployment, then create collections and RemoteApps.
  • RD Gateway (443) and VPN with NPS are the safe ways to bring outside users in.
  • Install RD Licensing before the 120-day grace period ends.
  • Test port 3389 before you start guessing at RDP errors.

Next lesson

Lesson 27: PowerShell automation → Next you’ll run commands on many servers with Invoke-Command, write a reusable script with parameters and error handling, schedule it as a task and turn the earlier checks into a daily server report.

Further reading: Remote Desktop Services

Want to go deeper into Remote Desktop Services? Microsoft’s Remote Desktop Services overview covers every role, and the RDS licensing guide explains CALs. You can also see the full plan for this course on the Windows Server Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.