?
Solved

ow to let windows server 008 automatically take actions frequently

Posted on 2014-01-26
5
Medium Priority
?
278 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this article, we’ll look at how to deploy ProxySQL.
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.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

771 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