[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ow to let windows server 008 automatically take actions frequently

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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
Suggested Courses
Course of the Month20 days, 6 hours left to enroll

873 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