hi,

i have a question,
iam making a logon script for laptop users (windows xp) on terminal server,
when there in the office they work on terminal service (citrix) and out of
the office they work local, when loggin on the citrix server we want to
determine the computername of he user to copy files to, how can we do this
with vbs script?
when i use this i get the computername of the server back,

sComputer = oNet.ComputerName
sAdsPath = "WinNT://" & sComputer & "/lanmanserver"
Set oAdsObj = GetObject(sAdsPath)

greets martijn

Re: detemine local computername by Richard

Richard
Tue Sep 16 17:13:52 CDT 2003

martijn spelt wrote:

> i have a question,
> iam making a logon script for laptop users (windows xp) on terminal
server,
> when there in the office they work on terminal service (citrix) and out of
> the office they work local, when loggin on the citrix server we want to
> determine the computername of he user to copy files to, how can we do this
> with vbs script?
> when i use this i get the computername of the server back,
>
> sComputer = oNet.ComputerName
> sAdsPath = "WinNT://" & sComputer & "/lanmanserver"
> Set oAdsObj = GetObject(sAdsPath)

Hi,

Terminal services has the special environment variables %clientname% and
%sessionname%, although I can't find documentation on them. You can use the
WshShell object to retrieve %clientname%.

Set objShell = CreateObject("Wscript.Shell")
strClientName = objShell.Environment("Process").Item("CLIENTNAME")

--
Richard
Microsoft MVP Scripting and ADSI
HilltopLab web site - http://www.rlmueller.net
--