Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

login to remote using "mstsc /admin" with password

I want to use mstsc /admin to login to a server silently. My batch file reads the code as

mstsc /v:xxx.xxx.xxx.xxx /admin

But it ask me to enter password. Can anyone help me to skip this step?

I went on to Google and found this site. But I am very new to this stuff (scripting) and could not understand what to do with given code. Is it a vbscript file? Can I do the same thing with a batch file. Please elaborate and I request you to spoon feed. This is not my arena but still I am pushed to fight without weapons.

My basic need is to kick off all users from a remote desktop except mine to perform some maintainable work. Thanks.

like image 560
Sandy Avatar asked Jan 23 '13 14:01

Sandy


People also ask

Can only RDP with mstsc admin?

three users can only take RDP by typing "mstsc /admin" in RUN and others by typing "mstsc" in RUN. all the users will use RDP at the same time. Issue here is only two users can login by typing 'mstsc /admin' in run at the same time.

What is the difference between mstsc and mstsc admin?

When you use this switch with MSTSC, connections don't consume Terminal Services CALs. The /admin switch involves elevated rights. If a user has the authority to use the /admin switch but has been marked with Deny Users Permissions To Log On To Terminal Server, he or she will be able to connect using mstsc /admin.

Why is my password not working on Remote Desktop?

If you get Your credentials did not work or your username or password is incorrect for Remote Desktop error, you need to run the Network Adapter Troubleshooter, change your username, etc. Other than these, you can add Remove Desktop Users in the Allow log on through Remote Desktop Services menu as well.


2 Answers

Re-posted as an answer: Found an alternative (Tested in Win8):

cmdkey /generic:"<server>" /user:"<user>" /pass:"<pass>"

Run that and if you run:

mstsc /v:<server>

You should not get an authentication prompt.

like image 94
Angelo Avatar answered Sep 29 '22 01:09

Angelo


the command posted by Milad and Sandy did not work for me with mstsc. i had to add TERMSRV to the /generic switch. i found this information here: https://gist.github.com/jdforsythe/48a022ee22c8ec912b7e

cmdkey /generic:TERMSRV/<server> /user:<username> /pass:<password>

i could then use mstsc /v:<server> without getting prompted for the login.

like image 34
Dili Avatar answered Sep 28 '22 23:09

Dili