Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Terminal Services Scripting question

Posted on 2006-11-13
3
Medium Priority
?
641 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

722 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