Automating remote desktop connection Automating remote desktop connection powershell powershell

Automating remote desktop connection


The problem in your attempt is the parameter /generic.

According to the official website for cmdkey, /generic

identifies the computer or domain name that this entry will be associated with.

In my example, I will call the computer Computer01.

Do you want the credentials associated with TERMSRV/Computer01 ? (Like your example /generic:TERMSRV/"computername or IP address " said)

No, you want it associated to the normal computername Computer01.

Then you have to remove TERMSRV/.

The working result is:

cmdkey /generic:"computername or IP" /user:"username" /pass:"password"

To your other questions:

  1. See the answer above
  2. I don't know if it's possible with HTML only. I don't think so. But I also implement some PowerShell scripts into ASP.NET. This works.
  3. See answer above.


A lot has changed since 2013. Many system operators already suggested to use ready-made tools which does this. Back in year 2013, Windows store wasn't that great a place (*my opinion). But now it's OK.

There is Microsoft's own Remote Desktop application in the store. The application is universal, that is, it runs on PCs, mobile phones, and holographic devices.

What's good? Microsoft has made the same app available on Android. I have tried for PC and Android. Both work great.

So have a try. I am regular user of these applications now.