Jump to content

Recommended Posts

Posted

Hi folks,

 

Every now and then we have the situation where a student has logged on somewhere in the school, forgotten to logoff, and then needs to logon elsewhere. Hence we need to log them off from all PCs in the school, so they can then logon.

 

Google shows a variety of methods of doing this, but they either apply to old versions of server, or are complex.

 

I just wanted to check with the latest version of server whether there was yet an elegant way to do this, or whether it's still complex?

 

(We use Ranger, just in case that has a tool for doing this)

 

TIA

Posted

Does it need to be done server side? There are plently of simple ways of doing it via script with WMI calls (or programs like EduRemote in my signature).

 

Just sends a WMI command to force logoff. (Unless Ranger blocks that for any reason?)

 

Steve

  • Thanks 1
Posted

Ideally server side, as the problem is trying to hunt down which PC the student is logged into.

 

I've tried EduRemote but get "Access denied" errors have tested it on one of the PCs here, albeit with an administrator that should have cross-domain rights.

Posted
pslogged on from pstools will find the machine, psshutdown will log them off.

psloggedon looks good, although is proving very slow in practise to identify where users are logged on.

Posted
would it not be possible to get a script that on logon added the pcname to the users description field. You can certainly add pc specs info taht way on pc bootup see no reason why the same logic cant be applied to users
Posted
Why do the students need to log out before they log in again?

 

Somewhere it is set so they can only be logged on once (Ranger possibly?).

 

The way I solved it was by using data collected by Lansweeper to check which computer they logged on to last. However, if you don't have any software currently tracking logons, it does make it quite tricky.

 

All we have over and above Windows Server is Ranger. I'm checking with RM whether it has any of this functionality.

Posted
Ranger's LAN Ranger Server > Network Explorer has a variety of views of logged on students, and can forceably log them off, as well as restart and shut down a PC. Hurrah!
Posted

we have a startup script that creates a hidden file called logincookie.dat this has date and time machine name

 

on log off it deletes the file

 

if the file exists the system displays a message and says you are logged on to machine name then logs the user off

  • 4 months later...
Posted
we have a startup script that creates a hidden file called logincookie.dat this has date and time machine name

 

on log off it deletes the file

 

if the file exists the system displays a message and says you are logged on to machine name then logs the user off

 

are u able to share that script?

 

nick

  • 4 months later...
Posted
are u able to share that script?

 

nick

 

 

 

sorry for the oldish bump, just that I was doing this exact thing today..

but i found a hole in the plan... (which is why i ended up here :) )

 

 

(please excuse my cruddy cmd skills)

 

 

@logon

rem  check for the logon file to exist
IF EXIST \\curricsvr2\logs$\logonchecker\%username%.log \\curricsvr2\netlogon\scripts\vbmessage.cmd

rem create a log file of usage by username
echo %username% >> \\curricsvr2\logs$\logonchecker\%username%.log

 

vbmessage.cmd

@echo MSGBOX "You are already logged on. Please log off that machine before starting a new session." > %temp%

\TEMPmessage.vbs
@call %temp%\TEMPmessage.vbs
@Del %temp%\TEMPmessage.vbs /f /q

sleep 3
logoff.exe

 

 

@logoff

rem  file check clear
del \\curricsvr2\logs$\logonchecker\%username%.log

 

 

 

which is the theory....

except...

it only works once!

because once you try and logon again - you get logged off. and then it calls the logoff script and clears your logon flag. So your free to login.

Posted
sorry for the oldish bump, just that I was doing this exact thing today..

but i found a hole in the plan... (which is why i ended up here :) )

 

 

(please excuse my cruddy cmd skills)

 

Put a check in the delete line, and only delete it if it's the same computer name as the one they're logged onto. (As the logfile would have the computer name in)

 

That way it won't delete the file unless it's the right computer that is logged off.

 

Steve

Posted (edited)

All of these scripts, and extra software isn't needed... Just KISS keep it simple..... pull up command prompt [net session] you can view all current sessions via username there. If you know the location of his connection ip/mac/host name just boot him via dhcp.

 

Disconnect sessions from a given machine

NET SESSION \\ComputerName /DELETE

Edited by rslulz
Posted
All of these scripts, and extra software isn't needed... Just KISS keep it simple..... pull up command prompt [net session] you can view all current sessions via username there. If you know the location of his connection ip/mac/host name just boot him via dhcp.

 

Disconnect sessions from a given machine

NET SESSION \\ComputerName /DELETE

 

Think you missed some posts out :) There's two questions, one was forcing people off which was answered awhile ago. And the later one is about limiting logons to one at a time, thus the scripts.

 

Steve

Posted (edited)
Think you missed some posts out :) There's two questions, one was forcing people off which was answered awhile ago. And the later one is about limiting logons to one at a time, thus the scripts.

 

Steve

 

I answered both questions in two replies sorry for the confusion. :)

 

Robert

 

ps: Another way to easily see/end sessions:

Server>Roles>File Services>Share and Storage Manager>Manage Sessions/Manage Open Files

 

I hope I've helped.

Edited by rslulz
Posted

Sorry for the double post. dont seem to be able to delete or edit posts on this site O.o

 

 

 

sorted it. thanks for the help steve21.

added wildcard to the file check, and added machine name to file creation and deletion. So it checks if the user is logged on to any machine but only deletes it if its the one with the right computer name.

 

 

@logon


rem  check for the logon file to exist
IF EXIST \\curricsvr2\logs$\logonchecker\%username%*.log \\curricsvr2\netlogon\scripts\vbmessage.cmd

rem create a log file of usage by username
echo %computername% >> \\curricsvr2\logs$\logonchecker\%username%-%computername%.log

 

 

@logoff


rem  file check clear
del \\curricsvr2\logs$\logonchecker\%username%-%computername%.log

 

 


@echo MSGBOX "You are already logged on. Please log off that machine before starting a new session." > %temp%\TEMPmessage.vbs
@call %temp%\TEMPmessage.vbs
@Del %temp%\TEMPmessage.vbs /f /q

sleep 3
logoff.exe

 

 

note:

vbmessage could just be replaced with any command, ie - shutdown.exe

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...