Link to home
Start Free TrialLog in
Avatar of David Lo
David LoFlag for United States of America

asked on

Windows Server Log Off Alert

I would like to get an email alert when someone logs off a Windows Server 2008.  

Is there an application or script that can handle this?

Thanks for your help.

David
ASKER CERTIFIED SOLUTION
Avatar of Praveen Kumar Bonala
Praveen Kumar Bonala
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Intrigued as to why you would want this, just out of interest.

I can supply part of a solution which is to create a server share for log off logs with read/write access to users utilizing this (Perhaps a group might be useful) , to use with the below batch example

e.g.

Filename = "Server Log Off.bat" (Or anything you see fit)
Add the text listed between the lines into the file, and correct the share name.

======================================================

rem The following line creates a circular log file of usage by server
echo Log Off %Date% %TIME% %USERNAME% >> \\servername\Logsshare\Computer\%COMPUTERNAME%.log

rem The following line creates a circular log file of usage by user
echo Log Off %Date% %TIME% %COMPUTERNAME% >> \\servername\Logsshare\User\%USERNAME%.log

=============================================================

When done, create a GPO applied to server users only under the log off scripts

User Configuration > Windows Settings > Scripts > Logoff

Now the question would remain as to how you can get the logged data emailed to you.
I might be over complicating it, but I would probably look at creating a scheduled email alert everytime that the log off event occurs on the event logs.

I found an article here which might help there, but if any others have a better solution, I'd look at what works best for you. The scheduled task on each server can be done via GPO to lower amount of time spent configuring it though.

http://blogs.iis.net/rickbarber/archive/2012/10/26/send-an-email-when-an-event-is-logged.aspx

EDIT: Or use the previous comments solution, seems to work more simple than mine.
rem The following line creates a circular log file of usage by server not circular since a circular log when the log reaches a certain size or other condition new events overwrite the oldest events. These logs are never ending..
Avatar of David Lo

ASKER

Thank you for your ideas.

If I am correct, these solutions are for all logoff events for the domain.  Is there any way to limit the monitoring to just the log offs on the server itself?
Avatar of schmiegu
schmiegu

The IntelliAdmin solution only works on the Server you create the scheduled task on. You may want to deploy the Task via Group policy, but there's no Need to