Re: TS Detection During Logon
- From: "Josh Rosenberg [MSFT]" <joshrose@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 24 May 2007 14:05:17 -0700
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
.
- Follow-Ups:
- Re: TS Detection During Logon
- From: JJ
- Re: TS Detection During Logon
- References:
- Re: TS Detection During Logon
- From: Josh Rosenberg [MSFT]
- Re: TS Detection During Logon
- From: Helge Klein
- Re: TS Detection During Logon
- Prev by Date: Re: TSCAL License Transition Site Problems?
- Next by Date: Re: Hardware for a 64-bit Windows 2003 Terminal Server
- Previous by thread: Re: TS Detection During Logon
- Next by thread: Re: TS Detection During Logon
- Index(es):
Relevant Pages
|