Solved

Terminal Services Scripting question

Posted on 2006-11-13
3
635 Views
Last Modified: 2008-02-06
Hi,

Not sure if it is supposed to go here but,

What I need to do is have a vbscript running at logon point (I know how to run this through the system policies) that determines the hostname (Terminal services calls it client name in the terminal services connection manager) and copies a certain file to a directory.

Is there a way in vbscript that I can ask what is the hostname of the connecting machine (the machine that is running the TS client software).
 and if it equals this then copy a file.


Thanks
Chris
0
Comment
Question by:acerimmer10
3 Comments
 
LVL 26

Accepted Solution

by:
Pber earned 500 total points
ID: 17937715
Look at the environment variable called: CLIENTNAME
Type SET at the command prompt when your TS'd into the remote box.

CLIENTNAME as the name implies is the connecting computer.

Thus in VBS:

set shell = WScript.CreateObject( "WScript.Shell" )
strClientName = shell.ExpandEnvironmentStrings("%CLIENTNAME%")
wscript.echo strClientName

Hope that helps.


0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

813 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

15 Experts available now in Live!

Get 1:1 Help Now