Solved

ow to let windows server 008 automatically take actions frequently

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

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
PHP loop not working 4 30
update field on focusout 15 22
Wordpress Body Class 5 11
Adding through query php 9 9
OfficeMate Freezes on login or does not load after login credentials are input.
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now