Solved

Logon to Terminal Server with command line options

Posted on 2004-10-29
1,238 Views
Last Modified: 2011-10-03
I need to switch the default printer for a Terminal Server client - printer1 for local default, Printer2 for TS default. I think I can do this with a script or reg file. I want to wrap the whole thing in a single script/bat file. How do you connect to Terminal Server with a command line - including the server name choice so it goes right to the connection, no boxes to click until you logon to Terminal Server?

I tried the command line with the IP, "Connect IP", and other guesses but no luck.

George
0
Question by:George46227
    15 Comments
     
    LVL 9

    Expert Comment

    by:BigC666
    howdy,

    have a look at this http://www.rlmueller.net/CreateUsers.htm

    hope that it helps
    0
     

    Author Comment

    by:George46227
    Either you posted to the wrong thread or maybe misunderstood the question. The link does not seem to have anything to do with connecting to Terminal Server with a command line/batch file. Help is always appreciated but I don't think we are "on the same page".

    George


    0
     

    Author Comment

    by:George46227
    11/23/04

    So far I have not received a response which provides an answer to the question. I am looking for the command line to launch a Terminal Server client connection, including any parameters/arguments. In NT you can make a dial-up or VPN connection to a remote machine from a BAT file using rasdial.exe plus some parameters. In Win98 you can do something similar using rundll32.exe with a ras dll file and connection name. I want to connect to a Terminal Server using a BAT file thus I need the command line.

    If there are no further responses in the next few days I will request the EE admins to close the question with no points awarded.

    George
    0
     

    Author Comment

    by:George46227
    11/26/04
    3:27pm

    I am going to do a pointer question to get some new responses.

    George
    0
     
    LVL 87

    Accepted Solution

    by:
    If the TS Client you are using is the version coming with windows xp (you can, as far as I know, download the client for use on other OS's from M$), you can start a command prompt, then enter "mstsc /?"
    A windows will now open with your possibilities, ie:

    /v:server:port -> this would be your TS ip address and if you aren't using the standard 3389 port you would also enter the port.
    /console -> you get the actual server's logon screen (the local display will get locked.)

    and so on.

    You can combine these command line options with .rdp file. This is a file you can create when you start the client from windows, you get the options you can enter, and then save as...

    The above commands can give different results depending on the version of TS running on your server. If it is a windows 2000 server, you won't be able to use the /console switch, for instance.

    Hope I was able to help or at least point you in the right direction
    0
     

    Author Comment

    by:George46227
    rindi
    11/27

    I am running w98se client from TS W2K. When I run the mstsc.exe /? (or /help, -?, -help) the TS client window pops up instead. mstsc.exe /v:ipaddress same thing. Am I having a syntax problem or does this client not support the command line ? I am running client 5.00.2195.3895. Will xp ts client work with w98se for TS W2K? Do you have a link where I can dl it? Also any reference article for the TS command line use?

    Thanks
    George
    0
     

    Author Comment

    by:George46227
    rindi
    11/27

    also - I don't find any .rdp file - how do I create and use it?

    George
    0
     
    LVL 87

    Expert Comment

    by:rindi
    I wouldn't know about clients for Windows 98. Try downloading this from the M$ site, Possibly the command line options will be the same here. An rdp file will be created when you start the client, but do not logon yet. You can define diverse settings like resolution etc. You can then save these settings and the result will be a .rdp.
    0
     
    LVL 87

    Expert Comment

    by:rindi
    0
     

    Author Comment

    by:George46227
    11/29/04
    rindi

    I installed the XP version on a Win98 pc (a different pc just for testing the install and command line), now I can do /? and see the options. Now about installing the XP version on my "production" TS client - can this XP version and the old W2K version run side-by-side on the my "real/production" W98SE TS client machine - I prefer not to do an "un-install" - the machine is used for TS admin and testing and is a very important machine, I am afraid I will mess up the TS client license. I am afraid to use the other pc that I installed the XP TS client on to make an actual connection to the TS - it might issue a license which I don't want to eat up another client license just for testing.

    George
    0
     

    Author Comment

    by:George46227
    11/29/04

    Just a FYI for everyone - I believe you can run TS client from a batch file this way (using the W2K TS client):

    Go to TS Client Client Connection Manager
    set up the connection:
    0
     
    LVL 87

    Expert Comment

    by:rindi
    If the Program name is different, then there shouldn't be any problem in running both versions parallel. The license shouldn't be touched if you use a different client. I'm not sure how M$ determines a what client is authorized, probably it'll depend on the OS type running on that PC and the PC's name (or the MAC address of the NIC). You may have to get in touch with M$ to make sure. But it definitly isn't a license violation if you have already licensed the machine and are just using another version of the client on it.
    0
     

    Author Comment

    by:George46227
    11/29/04

    SORRY! I hit a wrong key and lost my window!

    To continue the previous post:
    Client Connection Manager:
         New Connection and follow the wizard
         use the Properties later if you want to edit the connection
         you will have a connection name, server name/ip address, log on automatically option, screen size, startup in full or window, data compression, bitmap caching, startup program

    so go to the command line: "mstsc.exe MyConnection" and you will get connected using whatever info and options you specified during the set up of the connection.

    I think this will probably run in a batch file - don't see why not. I want to use it to run a .reg file to automatically re-set a user's default printer when they connect and dis-connect to the TS. Like:

    printer1.reg
    mstsc.exe MyConnection
    printer2.reg

    George
    0
     

    Author Comment

    by:George46227
    rindi
    11/30/04

    Just FYI for everyone - when you install the WinXP version of TSclient/Remote Desktop - it will remove your other version of TS client, so a parallel setup does not seem possible. It does migrate your previous settings - acts like an "upgrade". It appears in ADD/Remove and Start > Programs as "Remote Desktop Connection" - not Terminal Service Client. It did not give me a choice to "upgrade" or not.

    About the .rdp file - opened in Notepad, it appears mixed text/binary. I assume you can not directly edit or manually create an .rdp file - the only way is to configure a setting thru the GUI which then builds the .rdp file? Have you had any experience using the GUI to build .rdp files and then distributing the .rdp files to other pc's (to save time having to go to each pc and manually setting up the connection)? That is - can I take the .rdp file from my pc and copy it to another pc and use it (assuming the same version, etc.)?

    Also when running mstsc.exe - can i point it to a .rdp file for the connection setup - like "mstsc.exe MyConnection.rdp"?

    Thanks
    George
    0
     
    LVL 87

    Expert Comment

    by:rindi
    I don't think you can directly edit an .rdp file, I also had to create them using a GUI. I have distributed one to other systems and it worked, but those were all quite similar, so I'm not sure if it will work on a PC which, possibly, uses a complete different resolution.

    Yes, you can start the .rdp file from the command line (your example above uses the correct sysntax!).
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    Before you start a podcast of your own, you’ll need to get the right equipment. To help you get started off on the right foot, here’s a list of the four critical items you’ll need to start your own podcast.
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
    In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…

    875 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