Re: TS Detection During Logon

Tech-Archive recommends: Fix windows errors by optimizing your registry



I think his question was not whether the machine was a TS, but whether the user was logged in remotely. You can still log in to a TS machine normally, from a locally attached keyboard.

Correct me if I'm wrong, but it seems that @PRODUCTSUITE would only say if a machine was set up to be a TS, not whether it was being used as one by a particular user.

Like I mentioned, I believe you could use WMI from within your script to do this in a somewhat more elegant way than Perl, and more streamlined than 3rd party utilities. I believe this TechNet article should help:
http://technet2.microsoft.com/windowsserver/en/library/2955fe3f-747e-46a6-8825-eb9eb7baacae1033.mspx?mfr=true

--
Josh Rosenberg [MSFT]
SDE - Terminal Services


"Helge Klein" <Helge.Klein@xxxxxxxxxxxxxx> wrote in message news:1180037743.228520.53620@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Better and easier: use the logon script processor Kixtart (http://
www.kixtart.org). It has a builtin macro @PRODUCTSUITE which tells you
whether you are logging into a terminal server. Works well in many
environments I know.

Helge

On 24 Mai, 02:49, "Josh Rosenberg [MSFT]"
<joshr...@xxxxxxxxxxxxxxxxxxxx> wrote:
There is probably a WMI or WTS option for this that may work, though I'm not
personally familiar with it. I'm a Perl geek, so I tend to parse text
output from existing commands.

A simple script based approach would be to execute:
qwinsta <username>
where <username> is replaced by the user name of the person logging on.
<username> is optional, but limits the spew if there are a lot of users on
the server.

Parse the output to find the line which begins with the '>' character (w/o
the single quotes). This is the current user session. If the '>' is
followed by console, they are logged in locally, anything else means it is a
remote connection.

This works even if the user logged in remotely with /console, as /console
just puts them in session 0, it doesn't change the session type.

--
Josh Rosenberg [MSFT]
SDE - Terminal Services

"JJ" <J...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message

news:4B951416-5A03-4C69-B8B2-4AAD479ABA1B@xxxxxxxxxxxxxxxx

> How can I detect that a user is logging onto the Terminal Server during
> the
> Logon Script? I need to run additional script steps if it is not a
> Terminal
> Server session.

> --
> Thanks
> JJ



.



Relevant Pages

  • Re: NT 4.0 Domain with two Windows 2000 Terminal
    ... REM ** Jump out of the script if this is a TS-session, ... REM ** in a TS session ... MCSE,CCEA, Microsoft MVP - Terminal Server ...
    (microsoft.public.win2000.termserv.apps)
  • Re: Remote office logon script - Long Delay
    ... Windows IP Configuration ... If I point the User's profile to a script that doesn't contain the ... I do not have WINS configured for the remote site, ... This remote server was built using connect computer script, ...
    (microsoft.public.windows.server.sbs)
  • Re: Remote office logon script - Long Delay
    ... Windows IP Configuration ... If I point the User's profile to a script that doesn't contain the ... I do not have WINS configured for the remote site, ... This remote server was built using connect computer script, ...
    (microsoft.public.windows.server.sbs)
  • Re: Easiest way to share existing files saved on SBS server with remote users?
    ... on a SBS machine to a server-less remote office? ... The best method is Terminal Server, no matter what else, it's the only ... The key reason for terminal server is the savings in support, security, ...
    (microsoft.public.windows.server.sbs)
  • RE: WMI ExecQuery from Win32_NTEventLogFile in a Workgroup environ
    ... computer from which the script is being run? ... "urkec" wrote: ... as it correctly creates the .evt files for the local ... I have a script that runs on one node and copies files from all the remote ...
    (microsoft.public.scripting.vbscript)