Unable to access Azure VM

kinto 0 Reputation points
2025-04-17T13:44:54.4866667+00:00

Hello.

I’ve a Windows Server 2019 VM on an Hyper-V Host and I have a daily image backup of this VM on an Azure Storage Account (software used MSP360).

I’ve performed a restore on Azure of this VM with no problem I can also reach the shared folder on the VM using the Public IP assigned on Azure).

When I try to connect using RDP I’ve the error “The number of connections to this computer is limited and all connections are in use right now”.

The Azure Agent is installed (i’ve installed it on the VM present on the Hyper-V host) and I can run commands on the restored Azure VM.

The following items were already configured correctly on the VM OnPrem:

Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections

Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits

Before I ran the last backup from which I then restored I made sure that all remote sessions were disconnected.

On the Azure VM I have:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\ MaxInstanceCount is set to a value of 0xffffffff (the maximum value possible) 

qwinsta show
>services 0 Disc console 1 Conn 31c5ce94259d4... 65536 Listen rdp-tcp 65537 Listen

I’ve tried also to reset NIC and to Redeploy the VM.

Some ideas?

Thank you.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,681 questions
{count} votes

1 answer

Sort by: Most helpful
  1. kinto 0 Reputation points
    2025-04-17T18:19:33.9733333+00:00

    I supplement the information given above:

    In Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections

    • the "Restrict Remote Desktop Services users to a single Remote Desktop Services session" item is Disabled
    • the "UserSessionLimit" item is enabled and set to 999999

    In Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits

    • the "Set time limit for disconnected session" item is enabled and set to 2 hours
    • the "Set time limit for active but idle Remote Desktop Services sessions" item is enabled and set to 2 hours

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\MaxInstanceCount is set to a value of 0xffffffff (the maximum value possible). I've tried also with the default value (not configured).

    On the Azure VM I've not lunched "query session" but I've lunched "qwinsta show" which should provide equivalent information. Right?
    I remember that before launching the backup and then restoring to the cloud, I performed a reboot (shutdown -r -f -t 0) precisely to close any connections that might be idle or inactive.

    I tried connecting with “mstsc /admin” and also with Azure Bastion but with the usual problem.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.