Solved

Terminal Services Scripting question

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This may not be a text book method to resolve VSS backup issues but it seemed to have worked on few of the Windows 2003 servers we had issues while performing a Volume Shadow Copy backup. If you have issues while performing a shadow copy backup usin…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 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