[THIN] Re: Terminal Server - multiple logon attempts

  • From: "Boatman, Dave" <Dave.Boatman@xxxxxxxxxxxxxx>
  • To: "'thin@xxxxxxxxxxxxx'" <thin@xxxxxxxxxxxxx>
  • Date: Thu, 18 Jul 2002 13:16:13 +0100

http://thethin.net/r25b.zip

The above is a link to lockSingleuser2. I've used it with great success..
If you read the documentation it says to use " start LockSingleUser2"
I'd suggest that you use it with start /W - that way (assuming you change
the way the logon script processes all the user will see (assuming they are
login on twice) will be the lock user screen saying they have logged on
somewhere else already.

Or....Plonk this into the end of your login script. 


del %HomeDrive%%HomePath%user.txt
quser> %HomeDrive%%HomePath%user.txt
for /f "tokens=3" %%a in ('find /c "%username%"
%HomeDrive%%HomePath%user.txt')
do set tssemaphore=%%a
if %tssemaphore% GEQ 2 goto morethanone
goto lessthanone


:morethanone
start /w %SystemRoot%\System32\logononce.exe
logoff
goto end
:lessthanone
goto end
:end
del %HomeDrive%%HomePath%user.txt
set tssemaphore= 

* The logononce.exe was a simple VB Messagebox with an OK that said 
"Oi Muppet.. you've logged on more than once" -or something politer.
This was set to be system modal.. so that the user had to deal with it
first..  then they got logged off .. 

Dave Boatman

-----Original Message-----
From: Nishimura, Scott [mailto:Scott.Nishimura@xxxxxxx] 
Sent: 17 July 2002 21:21
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: Terminal Server - multiple logon attempts

You could do something like [using the cygwin UNIX tools]:

Create a program check_user.bat and call it from UsrLogn2.cmd.
Inside is
sh check_user.sh
rem calls the Bourne shell

The contents of check_user.sh:
quser > current_users.txt
# to generate a list of who is logged in

hit=`grep -x $username current_users.txt | wc -c`
# try to find the current username among those logged in.
# the "-x" is to match the entire line only [no partials].

if [ $hit -ne 0 ]
   then echo You are already logged in to this terminal server.  Logging off
now...
   sleep 10
   logoff
fi

I do something similar when checking the domain from which my users are
logging in; if it's the wrong one, I tell them and log them off.

The reason I use UNIX is that it is much more flexible when writing simple
programs.  For example, I don't know of an easy way to set a variable equal
to the result of another command in DOS.

You can get cygwin from

http://sources.redhat.com/cygwin/


Scott






-----Original Message-----
From: Roberto.Casagrande@xxxxxxxxxx
[mailto:Roberto.Casagrande@xxxxxxxxxx]
Sent: Wednesday, July 17, 2002 12:40 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: Terminal Server - multiple logon attempts


How would you do it with 1.8?

-----Original Message-----
From: Ron Oglesby [mailto:roglesby@xxxxxxxxxxxx]
Sent: July 17, 2002 2:40 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: Terminal Server - multiple logon attempts


With XP FR2 its easy.
With 1.8 it's a different story and requires som creative thinking.

Which are you using?

-----Original Message-----
From: Roberto.Casagrande@xxxxxxxxxx
[mailto:Roberto.Casagrande@xxxxxxxxxx] 
Sent: Wednesday, July 17, 2002 1:33 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Terminal Server - multiple logon attempts

Does anyone have the docs on how to prevent a user from logging in
multiple
times on the same WTS server?



===================================
This weeks Sponsor:
triCerat, Inc
ScrewDrivers fxp: Self Configuring Printer Driver with Bandwidth Control
Learn more at:
http://www.tricerat.com/?page=products&product=sdfxp

===================================
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link.

http://thethin.net/citrixlist.cfm



===================================
This weeks Sponsor:
triCerat, Inc
ScrewDrivers fxp: Self Configuring Printer Driver with Bandwidth Control
Learn more at:
http://www.tricerat.com/?page=products&product=sdfxp

===================================
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link.

http://thethin.net/citrixlist.cfm



===================================
This weeks Sponsor:
triCerat, Inc
ScrewDrivers fxp: Self Configuring Printer Driver with Bandwidth Control
Learn more at:
http://www.tricerat.com/?page=products&product=sdfxp

===================================
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link.

http://thethin.net/citrixlist.cfm



===================================
This weeks Sponsor:
triCerat, Inc
ScrewDrivers fxp: Self Configuring Printer Driver with Bandwidth Control
Learn more at:
http://www.tricerat.com/?page=products&product=sdfxp

===================================
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link.

http://thethin.net/citrixlist.cfm


***********************************************************
This message is confidential and intended for the exclusive 
use of the addressee(s) only and remains the property of 
Exchange FS Group plc. You should not disclose its contents 
to any other person. If you are not the intended recipient 
please notify the sender named above immediately.

Registered Office: Munro House, Portsmouth Road, Cobham, 
Surrey, KT11 1TE. Registered in England No. 2596452
***********************************************************




===================================
This weeks Sponsor:
triCerat, Inc
ScrewDrivers fxp: Self Configuring Printer Driver with Bandwidth Control
Learn more at:
http://www.tricerat.com/?page=products&product=sdfxp

===================================
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link.

http://thethin.net/citrixlist.cfm

Other related posts: