In some cases users cannot sing-in to RDS farm hosts running Windows Server using the built-in RDP client (mstsc.exe) with the following error:
The task you are trying to do can't be completed because Remote Desktop Services is currently busy. Please try again in a few minutes. Other users should still be able to log on.
In this case, the RDS host admin can see many stuck user sessions with the name (4) instead of usernames and Disconnected status in the Users tab of Task Manager.
The problem occurs in all current Windows Server versions: 2012 R2, 2016, 2019, and 2022.
The error may appear for a number of reasons:
- An error in the operation of the Remote Desktop Services;
- A bug in the csrss.exe process;
- An issue with a user profile or profsvc service;
- Running out of RAM or hard drive space on the RDS host;
- Incorrect Group Policy settings.
Unfortunately, there is no official Microsoft solution that can completely fix the problem. All you can do is get rid of the symptoms.
Troubleshooting almost always involves resetting a problematic user RD session or restarting the RDS server, but in some cases, the problem persists. Let’s study the solutions starting with the easiest one
Check RDS Host Performance and Available Resources
As this error may occur due to a lack of RAM or free disk space, make sure that the server has sufficient resources. Check that there is enough free RAM and hard disk space where the operating system is installed (there should be at least 1 GB free), clean up RDS user profiles from old files, and delete old (unused) user profiles. Also, check the event log for critical errors in relation to Remote Desktop Services and User Profile Service (profsvc).
If there are enough free resources, go to the next option.
Reset Hung Remote Desktop Sessions on RDS
First of all, try to find and reset a session of the user who cannot log in to the RDS server with the error “Remote Desktop Service is currently busy
”. Find a user in the Users tab of the Task Manager and click Log off in the context menu. In most cases, this will solve the problem, but sometimes you may find several hung sessions in Task Manager with the name (4) instead of a user name. A hung RDS user session will typically have 4 running processes::
- Client Server Runtime Process (csrss.exe)
- Desktop Windows Manager (dwm.exe)
- Windows Logon Application (winlogon.exe)
- Windows Logon User Interface
Try resetting any hanging (4) RDS sessions using Task Manager as described above. If this does not help, you will need to manually kill the running processes in these sessions.
- Open an elevated command prompt and run the command:
query session
The command displays a list of all users and their sessions on the RDS host. There are 3 columns we need in the output: SESSIONNAME, USERNAME, and ID. Find the(4)
user and the corresponding ID, in this example, it is ID 2. You must kill thecsrss.exe
process that is running in this session; - Run the command:
query process /id 2
The command shows all processes running in the session with the specified ID. We need to find the PID of the csrss.exe process. In my case, the PID is 5140. You need to kill this process. - Kill the csrss.exe process by its PID:
taskkill /F /PID 5140
When the csrss.exe process is finished, all other processes in the user’s session are automatically terminated. This allows you to end hung RDS user sessions without having to restart the server.
Do it for each (4) user if there are some of them.
Also, if you are working on unreliable links, we recommend that you set the GPO option Configure keep-alive connection interval to 1 minute (Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Connections).
Kill a Remote Desktop User Session with Command Prompt
If you have been unable to log off a user, you can try resetting an RDS user session from the command prompt:
- Open the command prompt as administrator and run the command:
query session
- End the user’s session using their SESSIONNAME or ID. For example:
reset session rdp-tcp#16
or:
reset session 3
This needs to be done for every problematic RDS user. Now you can try logging in, the problem should be solved.
If the RDS server does not allow you to sign in even under the local administrator account, you can remotely get a list of user sessions on the computer
qwinsta /server:mun-rds01
You can then end the hung session remotely:
reset session rdp-tcp#16 /server:mun-rds01
Check Licensing Settings on your RDS Host
Make sure that the license server and license type (CAL Per User/ CAL Per Device) configured on your RDSH host are correct.
The address of the server with RDS licenses can be specified:
- In the RDS collection settings: Tasks -> Edit Deployment Properties -> RD Licensing -> Specify a license server;
- With the Group Policy option Use the specified Remote Desktop license servers (Computer Configuration -> Policies -> Admin Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Licensing)
- Using PowerShell (see the article Licensing mode for the Remote Desktop Session Host is not configured).
Disable the RDP Max Connection Limit in GPO
You can use Group Policies to limit the number of concurrent (simultaneous) RDS connections. By default, this policy is not configured. This means that the maximum number of connections is not limited by the RDSH host.
Use the gpresult to check if the policy is enabled and what value it has.
- Run the following command in the elevated command prompt:
gpresult /H c:\gpresult.html
- Open the gpresult.html file located in the root of the C drive. It is a common .html file that can be opened using your browser ( Internet Explorer is disabled by default in modern Windows builds, and you should use MS Edge.);
- Find the GPO setting named Limit number of connections under Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host\Connections or type Limit number of connections to search on the page.
If there is no such policy, then it is not applied and there are no restrictions on the number of simultaneous connections. If there is a policy and the number of simultaneous connections is indicated, change its value to the number you need. You can configure the GPO option using the local Group Policy Editor (gpedit.msc
), and if the policy is set through domain GPOs, edit it with the domain GPO editor (gpmc.msc
). After you have done it, don’t forget to run the gpupdate /force
command to apply the new Group Policy settings immediately.
Other Ways to Fix Busy RDP Service Issues
If there are enough free resources on the host, there are no errors in RDP logs, resetting the user’s session hasn’t helped for some reason, and you can’t restart the RDSH server immediately, then you should try the following options:
- Ensure that the RDS host is not in the Drain mode, which prevents users from making new RDP connections:
chglogon.exe /QUERY
. If the command returns ‘New user logons are DISABLED, but reconnections to existing sessions are ENABLED,’ disable Drain mode:chglogon.exe /enable
- Uncheck the Persistent bitmap caching option in the RDP connection settings of the
mstsc.exe
client. Try using the 56kbps modem mode to optimize performance; - Restart the Remote Desktop Service using the commands:
net stop termservice
andnet start termservice
. Or restart the service remotely using PowerShell:Get-Service termservice –ComputerName mun-rdsh1 | Restart-Service
- Kill all tstheme.exe processes;
- It is recommended to install all the latest updates for your Windows version. Use the standard Windows Update tools or the PSWindowsUpdate PowerShell module.
- On Windows Server 2012 R2, event ID 20499 may appear in Event Viewer “Remote Desktop Services has taken too long to load the user configuration from server..“. To resolve this issue, add the fQueryUserConfigFromLocalMachine registry entry:
REG ADD "HKLM\SYSTEM\CurrentControlSet\control\Terminal Server\Winstations\RDP-Tcp" /v fQueryUserConfigFromLocalMachine /t REG_DWORD /d 1 /f
REG ADD "HKLM\Software\Policies\Microsoft\Windows NT\Terminal Services" /v fQueryUserConfigFromLocalMachine /t REG_DWORD /d 1 /f - If Citrix is installed on your Windows host and there are a lot of disconnected sessions on the VDA Server, you can fix an issue by creating the SeTokenDoesNotTrackSessionObject registry entry:
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Kernel" /v SeTokenDoesNotTrackSessionObject /t REG_DWORD /d 1 /f
- Check the User Profile service (
profsvc
) logs. If you are using User Profile Disk (UPD) or FSLogix profiles on Windows Server, check that the file server containing the profile files is available and not experiencing performance issues. Also, when using UPD on Windows Server 2019/2016, create the DeleteUserAppContainersOnLogoff registry parameter, which will fix issues with many Windows Defender firewall rules that are generated for UWP Windows Store apps every time a user logs in.This is described in the article Poor RDS performance on Windows Server 2016/2019 with User Profile Discs.
1 comment
I dont have any other users on my pc Because of that I acces to to my computer and i cant acces after the welcom scrern What can i do!?