Greetings.
I recently stumbled across Cassia while trying to find useful code to interact with our RDS servers. I have integrated Cassia and it works very well. I list our available servers and I can:
*List sessions on a server or all servers (users, sessionID, I.P., idle time, etc.)
*List Processes for a user
*Send a user a detailed message (wait for a reply or not)
*Log a session (user) off
*Send all users a message
When I list sessions I color code sessions that have been idle for a certain time and sessions that are disconnected. This tool has been very useful.
I would like to provide the capability to kill a particular process without simply logging the user off. Looking at Cassia help* it appears that I can use the Kill method in the following way:
Kill(handle,processid)
*I actually found this in TerminaServicesProcess.cs:
public void Kill(int exitCode)
{
NativeMethodsHelper.TerminateProcess(_server.Handle, _processId, exitCode);
}
I would appreciate any code samples that any of you might have showing a good way to select a session and provide the server.handle in the proper way. I suppose I could just select the session from my listview control where I show the session info for each session and use it along with the server name to then get the server handle and pass that into the Kill method.
I'd love to see your solution to using the Kill method.