Solved

RDP session scripting

Posted on 2009-07-12
3
825 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

My previous article  (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2008/A_4466-A-beginners-guide-to-installing-SCCM2007-on-Windows-2008-R2-Server.html)detailed one possible method to get SCCM 2007 installed an…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

930 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now