You can configure Terminal Services to launch an application when a user
logs on. If this is a Perl script it could just run in the background
and watch things. Through the Lanman TS API you can enumerate which
processes are running in a given TS session. The attached script does
just that.

However if this script is run in the user's session I believe it runs
under his credentials thus he can terminate it. Therefore making it a
service is probably the better idea. You can use PerlSvc or
Win32::Daemon. Personally I prefer Daemon but I am biased. ;)

I have a Win32::Daemon script that runs on our servers that monitor the
process list. If a "restricted" process is run for too long (according
to settings in a config file) it is terminated. This prevents someone
from leaving an FTP session running (for example).
I have two versions of this daemon: one that uses hard core programming
to get the process list and another which uses WMI. The WMI is much
easier to use but at the cost of memory and CPU use.

The latest Win32::Daemon supports callbacks making it really easy to
create services. Refer to http://www.roth.net/perl/daemon/ for examples
of callback use.

dave 



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
MJG
Sent: Sunday, October 26, 2003 5:53 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: Win32::Service problems.



What would be the best way to monitor if someone launches an app in a
Terminal Server environment?

I would like to launch a "Controller" app as a user logs in.  Collect
their User ID (UID) drop to the system tray and watch, or just launch
and watch, w/o dropping to the sys tray.     The functionality of the
"Controller" is to watch for when a user launches an app, Outlook for
example, test to see if another should launch with it as a "Helper".  An
example of a helper would be a HotSync utility launching with Outlook.
When Outlook closes, the HotSync utility is shutdown by the "Controller"
app.  The Controller has to see Outlook launch.

I've looked through LanMan and it doesn't appear to be within it's
capabilities.  My concern is that the only way to see if a new app is
launched is to constantly poll WMI for a list of the process stack and
compare it to when the "Controller" app first came on line.  This isn't
very efficient.

Would PerlSvc be the way to go?

Thanks

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Attachment: WTSProcList.pl
Description: WTSProcList.pl

Reply via email to