As an alternative to my other answer (this question got me thinking!), you could also consider using a combination of two things:
- Set up a scheduled task on each workstation to run a logoff script. The trigger would be a specific event log entry.
- Use a .vbs script on your own desktop to post the trigger entry to the event log.
Taking these in turn:
You'd need to log in as each user, I think, and add a new task with a custom trigger: Triggers | New | 'On an event' | Custom | New Event Filter | XML | 'Edit manually'. Then use something like the following for the XML:
<Query Id="0" Path="Application">
<Select Path="Application">*[System[(Level=4 or Level=0) and (EventID=4)]] and *[EventData[Data='EVERYBODY_OFF']]</Select>
That will look for information events in the Application log with the EventID of 4 (information), and the data body of 'EVERYBODY_OFF'. You can read more about event triggers here.
The action should be able to be as simple as
shutdown -l, which should trigger a logoff (you'll want to test it).
The following .vbs script will log the 'EVERYBODY_OFF' event on demand:
const EVENTLOG_INFORMATION = 4
strMessage = "EVERYBODY_OFF"
set objShell = CreateObject("WScript.Shell")
objShell.LogEvent EVENTLOG_INFORMATION, strMessage
Stuff to Test
The bits I'm not sure of, and which will take a bit of testing:
- Is that the event message that is posted global to the machine? I.e., will all users see the task?
- Will the shutdown command run correctly in the context of the target user?