Solved

ow to let windows server 008 automatically take actions frequently

Posted on 2014-01-26
5
267 Views
Last Modified: 2014-02-01
Dear,
I have a database with 1000 uer,
Each time a user login to the server, i add 1 to a counter field in the database.
I want if a user didnt logged in for 2 days to let the server send him and email automaticallly.

the sendmail.php and checklogin.php pages are ready.
I am using windows server 2008.
Any idea?
0
Comment
Question by:hassanayoub85
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 11

Expert Comment

by:Manjunath Sullad
ID: 39811453
Hi,

You need to create a schedule tasks to perform this task,

If you want to export user list, who not logged in for days, Please refer below link and implement,

http://social.technet.microsoft.com/Forums/windowsserver/en-US/eaff2f69-d17b-4235-9f8a-9f42840cac56/90-day-inactive-user-report-using-powershell?forum=winserverpowershell

Script : http://gallery.technet.microsoft.com/scriptcenter/Inactive-Users-Script-76eb43f4


Once you have user list, create a SMTP server and import user list and trigger a mail.
0
 

Author Comment

by:hassanayoub85
ID: 39811458
dear, the users are not in the windows itself, but they are in mysql table.
0
 

Accepted Solution

by:
hassanayoub85 earned 0 total points
ID: 39812691
0
 
LVL 33

Expert Comment

by:snoyes_jw
ID: 39812709
MySQL has init-connect, which you can use to cause any login by a non-SUPER user to update a table.

http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_init_connect

Perhaps something like:

init_connect='UPDATE mydb.userCount SET count = count + 1 WHERE userName = CURRENT_USER()'

Then use a scheduled task to run a script to check that table and send the email.
0
 

Author Closing Comment

by:hassanayoub85
ID: 39826102
I found the solution myself
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question