Solved

Terminal Services Scripting question

Posted on 2006-11-13
3
633 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

So you have two Windows Servers and you have a directory/folder/files on one that you'd like to mirror to the other?  You don't really want to deal with DFS or a 3rd party solution like Doubletake. You can use Robocopy from the Windows Server 200…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

22 Experts available now in Live!

Get 1:1 Help Now