Log in to the server with the following command first:
mstsc/v:{Server IP}/admin
You can then use one of the following methods.
Method One:
1. Click start → run, enter "Gpedit.msc" to open the Group Policy Editor window, navigate to "Computer Configuration (computer) → Administrative Templates (Administrative Templates) →windows Component (Windows components) → Remote Desktop services → Remote Desktop Session host → licensing, double-click Set Remote Desktop licensing mode in the right window, tick the enabled option, In the lower left window, change the drop-down list option to "Per user", click Apply, and close the window when you are sure.
2. Select Dashboard in the Server Manager, select Manage → remove roles and features from the menu in the upper-right corner, select server roles in the pop-up window, expand the Remote Desktop Services node in the list of roles on the right, deselect Remote Desktop Licensing, click Next until "Delete" appears in the lower right corner option and then click "Delete".
Method Two:
Start-run regedit
Registry, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing
Select MSLicensing to remove it
"The remote session was interrupted because this computer does not have a Remote Desktop Client Access License" solution