Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Terminal Services Scripting question

Posted on 2006-11-13
3
Medium Priority
?
644 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
1 Comment
 
LVL 26

Accepted Solution

by:
Pber earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

824 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