Add a User to Remote Desktop Users in Windows Remotely



  • It seems relatively common that I have to work in a Windows environment where I have proper admin credentials, and have access to a workstation in the environment, but cannot remotely access a server (or sometimes another workstation) in the environment because no tools have been configured to access it and RDP has not been set up. In many cases you can solve this issue with psexec.

    Adding the User to the Remote Desktop Users Localgroup with CMD and PsExec

    First, download and install the latest PsExec from Sysinternals.

    Then open the command prompt and run this command (substitute the name or IP address of the machine that you want to be able to access remotely.) Also change the name from administrator to whatever account is appropriate for your environment. This guide assumes that you are logged in with an account that has proper access for this command.

    psexec \\yourservername net localgroup "remote desktop users" /add administrator
    

    If the only issue was that RDP was set up, but not permissioned for your user account, this should resolve that. This is one that I need relatively often when beginning to manage a new account.


    You can also do the same process, but interactively, which is far less efficient, but still valid, using the same tools.

    psexec \\yourservername cmd.exe
    

    Then once logged into the remote machine's CMD environment:

    net localgroup "remote desktop users" /add administrator


  • If PowerShell remoting is available you couple possibly use Invoke-Command with Add-LocalGroupMember.



  • Though I've seen screwiness for using Add-LocalGroupMember to add users to the local administrators group. Unfortunately, at the time I didn't have the time to troubleshoot it. If I can get around to it, I'll see if I can replicate the problem and post about it in this thread.



  • @EddieJennings said in Add a User to Remote Desktop Users in Windows Remotely:

    Though I've seen screwiness for using Add-LocalGroupMember to add users to the local administrators group. Unfortunately, at the time I didn't have the time to troubleshoot it. If I can get around to it, I'll see if I can replicate the problem and post about it in this thread.

    When I see the need for this, it is very often is really old, out of date environments where I expect PowerShell to be missing 🙂



  • @scottalanmiller said in Add a User to Remote Desktop Users in Windows Remotely:

    @EddieJennings said in Add a User to Remote Desktop Users in Windows Remotely:

    Though I've seen screwiness for using Add-LocalGroupMember to add users to the local administrators group. Unfortunately, at the time I didn't have the time to troubleshoot it. If I can get around to it, I'll see if I can replicate the problem and post about it in this thread.

    When I see the need for this, it is very often is really old, out of date environments where I expect PowerShell to be missing 🙂

    Or environments where folks that shouldn't need RDP access get to have it ;). I got tired of RDPing to VMs myself just to get to the GUI to add people to either Administrators or Remote Desktop Users; thus, I found the cmdlet.

    But yeah, I want to think that cmdlet came with PowerShell 5, so older systems won't have it.



  • I seem to remember doing this via ScreenConnect CMD

    I don't recall the syntax at the moment,... but I'm sure it's documented somewhere... while I used CMD, no reason PS won't also work.



  • @gjacobse said in Add a User to Remote Desktop Users in Windows Remotely:

    I seem to remember doing this via ScreenConnect CMD

    Only works if SC is installed, which if it was, we'd not need to do it 🙂