Is it possible to add a user to the allowed rdp accounts from the commandline?
Asked
Active
Viewed 6.5k times
1 Answers
17
Sure, you can use the NET
command:
NET LOCALGROUP "Remote Desktop Users" domain\jscott /ADD
This would add the domain user domian\jscott to the local group Remote Desktop Users. If you'd like to add a non-domain user, simply leave off the domain prefix:
NET LOCALGROUP "Remote Desktop Users" keyoke /ADD
This would add the local user keyoke to the local group Remote Desktop Users.

jscott
- 24,484
- 8
- 79
- 100
-
great if machine is not part of domain would I just use COMPUTER-NAME? – keyoke Mar 07 '12 at 11:55
-
See edits for adding local user. – jscott Mar 07 '12 at 11:59
-
ah crap... dont have sufficient permissions and cant remember my admin password – keyoke Mar 07 '12 at 12:02
-
@keyoke Have a [quick search of related questions](http://serverfault.com/search?q=reset+admin+password+windows&submit=search), it's not much work to reset the local administrator's password on Windows. – jscott Mar 08 '12 at 00:19
-
You may need to set Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server:fDenyTSConnections to 0 in addition if RDP isn't enabled on the machine – Rahul Misra Oct 29 '20 at 10:04