Solved

Script to Automate a Remote Desktop connection with Username and Password

Posted on 2011-02-21
8
3,247 Views
Last Modified: 2012-05-11
Good-day,
I would like to create a script that allows me to automatically logon to a server (via RDC) with the username and password already specified in the script.  Is this possible, if so how?
Thank you
Heather
0
Comment
Question by:habbotha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 39

Accepted Solution

by:
Krzysztof Pytko earned 200 total points
ID: 34941752
You cannot do that directly from command-line (with user name and password). First, create an RDP file with server name, user and password, save it as RDP file and then you will be able to connect using

mstsc RDPfilename.rdp

Regards,
Krzysztof
0
 
LVL 3

Expert Comment

by:Patricck
ID: 34941759
0
 
LVL 9

Assisted Solution

by:Tomas Valenta
Tomas Valenta earned 150 total points
ID: 34941776
Try using this tool, maybe helps you better then script.
http://terminals.codeplex.com/
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 70

Assisted Solution

by:Qlemo
Qlemo earned 150 total points
ID: 34941860
MSTSC does not allow for credentials to be provided on command line. Your options are
(a) to use 3rd-party software, like DameWare
(b) to use the ActiveX control - needs an application written around it.

Creating a .rdp file will allow to provide the username, but no password - that is stored in your local security settings (SAM), and needs to be provided at least once per computer.
0
 

Expert Comment

by:PachoVilla
ID: 34942165
Why do you need it to be a script?
Otherwise for auto logon using RDP,
create a new management console,
(Run: mmc)
add the "Remote Desktop" module,
add the machines adress you need including logon info,
(especially handy if you have more machines you want to "auto-logon" to)
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 35886218
Could you tell us please why you accepted only that answer? IMHO the first one from iSeek (http:#a34941752) should be accepted in addition, and optionally mine and/or Tominov's.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question