It sounds like you need a Session Event Trigger of some sort.
Triggers are defined in an IF-THEN format (or should I say Filter-Action, to use Control's jargon).
In your case, that would be:
IF
Quote:a machine goes online
THEN
Quote:change the password
and
Quote:immediately log the user off of the machine
The IF (or Filter) part is easy enough to define:
Event.EventType = 'Connected' AND Connection.ProcessType = 'Guest' AND Session.SessionType = 'Access'So go to the Triggers page, create a new trigger and enter the above into the Event Filter.
The THEN (or Action) part is the tricky one.
That's because there are two significant limitations on executing commands, one set by Windows and the other set by Control.
Let me explain.
Action #1: Changing the passwordThis action would be a QueuedCommand event.
So choose 'Add as Session Event' and for Event Type select 'QueueCommand'.
Then, in the Data field, enter the following (replace the words in CAPITALS with the relevant values):
net user USERNAME NEWPASSWORDIf only you could use {Session.GuestLoggedOnUserName} as the USERNAME value, that would make life so simple.
But for some reason Control doesn't let you use variables in the Data field of Event Actions, even though they work perfectly fine in the Body and Subject fields of HTTP and SMTP Actions.
This is the Control limitation I was talking about. It's really annoying, I know.
It means that you have to create a trigger for each machine you have and specify the username. Ugh.
Action #2: Logging the user offThis action would be also a QueuedCommand event.
If only you could use
shutdown /l command, but it doesn't work when executed remotely.
And this is the Windows limitation I was talking about earlier.
The only alternative, as far as I know, is to use the command:
logoff SESSIONBut you need to know the SESSION value to use that, which you can get with the command
query sessionBut this means you need at least two steps. But a trigger can't be defined to retrieve a value from the output of one command and plug it into the input of another command.
Your best bet then is to assume that the SESSION value is 1. It's an assumption that won't always pan out, but I reckon it'll work in most cases?
But I'm not an expert on cmd.exe, so maybe there is a workaround?
The next version of Control will support PowerShell, so maybe that'll allow you to log off in one step? I'm not an expert on PowerShell either, so I don't know.
