Solved

RDP session scripting

Posted on 2009-07-12
3
827 Views
Last Modified: 2013-11-21
Is there a way to script an RDP session? We have a farm of Terminal Servers and there is an application on one Terminal Server that for various reasons can't be installed on any other Terminal Servers.  Is there any way that I can script an RDP session from the other Terminal Servers that would RDP into the 'special' TS and automatically run the program so that it would be transparent for the user e.g. they would just click on an icon and after a few flashes they would be getting the splash page of the  target program running on the 'special' Terminal Server and when they exited the program it would take them back to their own TS.  I know about application virtualization and the products for it but that's not on for this situation. Home made solutions are all that's allowed by this budget.  The servers are running Windows 2000 TS.
0
Comment
Question by:lineonecorp
  • 2
3 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 300 total points
ID: 24836091
Hmm - I can't say for certain if this is possible with W2k, but it is with W2k3.
Click Start->Run->mstsc <Enter>

Now, you would adjust the session as needed (may have to click Options first).
From the Programs tab, there's a check mark to 'run this program' on connection - enter the application there after checking the box.
Click OK (after making any other needed adjustments).

Now click Save As and save it in the windows\system32 folder as "special.rdp"

Now create a desktop shortcut that launches a single-line batch file containing:

where SERVERNAME is the 'special' server's computer name...


@mstsc "%systemroot%\system32\special.rdp" /console /v SERVERNAME

Open in new window

0
 

Author Closing Comment

by:lineonecorp
ID: 31602646
Great little trick. I can see a lot of uses for this. Thanks.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 24838262
Glad I could help.
I use that batch file quite often...
Mine is a bit longer and targeted for different scenarios - perhaps you'll find use for it as well.
I've named it cnx.cmd, also stored in my system32 folder, so I can click Start->Run-> cnx servername <Enter>
which allows the servername as a parameter - different servers provide different scenarios (just an example - can be broadened to include multiple servers):
@echo off
set srv=%1
 
If [%srv%]==[] goto usage
If /i [%srv%]==[server1] set parm=/console
 
mstsc %systemroot%\system32\nonconsole.rdp %parm% /v %srv%

Open in new window

0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Have you considered what group policies are backwards and forwards compatible? Windows Active Directory servers and clients use group policy templates to deploy sets of policies within your domain. But, there is a catch to deploying policies. The…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 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