Gongalong Posted February 1, 2012 Posted February 1, 2012 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
Steve21 Posted February 1, 2012 Posted February 1, 2012 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 1
strawberry Posted February 1, 2012 Posted February 1, 2012 pslogged on from pstools will find the machine, psshutdown will log them off. 1
Gongalong Posted February 1, 2012 Author Posted February 1, 2012 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.
Gongalong Posted February 1, 2012 Author Posted February 1, 2012 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.
p858snake Posted February 1, 2012 Posted February 1, 2012 Why do the students need to log out before they log in again?
AngryTechnician Posted February 1, 2012 Posted February 1, 2012 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.
sted Posted February 1, 2012 Posted February 1, 2012 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
Gongalong Posted February 1, 2012 Author Posted February 1, 2012 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.
Gongalong Posted February 1, 2012 Author Posted February 1, 2012 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!
round2it Posted February 1, 2012 Posted February 1, 2012 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
Davit2005 Posted June 27, 2012 Posted June 27, 2012 pslogged on from pstools will find the machine, psshutdown will log them off. I'm not sure if psshutdown is Windows 7 compatible :-$
AngryTechnician Posted June 27, 2012 Posted June 27, 2012 Also was looking for a way to do this: try this small utility: LogoffStandby @rinzwind, are you the author of this software?
AngryTechnician Posted June 27, 2012 Posted June 27, 2012 I'm not sure if psshutdown is Windows 7 compatible :-$ It is. Use it here all the time.
bart21 Posted June 28, 2012 Posted June 28, 2012 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
levell3r Posted November 16, 2012 Posted November 16, 2012 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.
Steve21 Posted November 16, 2012 Posted November 16, 2012 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
levell3r Posted November 19, 2012 Posted November 19, 2012 thanks for the reply, though i'm not entirely sure how that works.
rslulz Posted November 19, 2012 Posted November 19, 2012 (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 November 19, 2012 by rslulz
rslulz Posted November 19, 2012 Posted November 19, 2012 Somewhere it is set so they can only be logged on once (Ranger possibly?). All we have over and above Windows Server is Ranger. I'm checking with RM whether it has any of this functionality. Windows created something for that. How can I limit the number of allowed concurrent sessions per user in an Active Directory (AD) domain?
Steve21 Posted November 19, 2012 Posted November 19, 2012 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
rslulz Posted November 19, 2012 Posted November 19, 2012 (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 November 19, 2012 by rslulz
levell3r Posted November 19, 2012 Posted November 19, 2012 steve21, any pointers for setting the script to check log file contents?
levell3r Posted November 20, 2012 Posted November 20, 2012 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now