Solved

ow to let windows server 008 automatically take actions frequently

Posted on 2014-01-26
5
259 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
  • 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
NTFS Permissions 6 49
PHP not parsing ' character 12 40
how to use a switch statement with heredoc 11 25
Is there a simpler dropbox system? 10 24
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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.

831 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