Possible to run a report for uptime > 10 days and email the user?
We have a big problem with users never rebooting their computers. We cannot do a force reboot once a week (which i'd love to do!). I can create a report that has the users with uptime > X amount of days. Is there a way to get this report to also email the users that they have not restarted and need to do so? I know this is probably a long shot but thought i'd check.
Community Chosen Answer
Here is another suggestion, if your usernames match an email address (e.g. username = tsmtih and email is tsmith@SomeDomain.com) you can combine a SQL query with the service desk ticket rules.
Using this SQL (or something like it)
concat(ORG1.MACHINE.USER,'@someDomain.com') As EMAILCC,
ORG1.MACHINE.USER_FULLNAME As USER_FULLNAME,
Unix_Timestamp(Now()) - Unix_Timestamp(ORG1.MACHINE.LAST_SYNC) As
Unix_Timestamp(ORG1.MACHINE.LAST_SYNC) As LAST_SYNC_SECONDS,
ORG1.MACHINE.NAME as machineName
ORG1.MACHINE Left Join
KBSYS.KUID_ORGANIZATION On KBSYS.KUID_ORGANIZATION.KUID = ORG1.MACHINE.KUID
KBSYS.SMMP_CONNECTION On KBSYS.SMMP_CONNECTION.KUID = ORG1.MACHINE.KUID And
KBSYS.KUID_ORGANIZATION.ORGANIZATION_ID = 1
ORG1.MACHINE.LAST_REBOOT < Date_Sub(Now(), Interval 10 Day)
Head over to the Service Desk, custom ticket rules. Create a new ticket rule that runs daily using the SQL above.
Check the checkbox that reads, "Send an email for each result row"
Subject field = "Please reboot your computer" or whatever you want it to say
Email column = "EMAILCC" without the quotes
Email Body = can say whatever you want. If you want to use values from the query above you have to prepend them with a $ (like php variables)
If your usernames do not match email address the above is still possible, just a little more complicated. I haven't tested this, but I think it will work.
Basically you need to create a custom asset for your usernames that contains their email address. That is, two columns in the custom asset to contain the username in one that matches what Kace finds in the above query to an email address. For the custom asset you created, you can do a data import from some other system to get the usernames and email addresses in. You might also be able to just use the "Users" tab within the service desk, but I am uncertain about how to import data into "Users." Using the example above, if your username is tsmith and the email is email@example.com then the record would look like this within the custom asset:
Now your SQL query needs to be modified above to join the machine table to the custom asset on the machine.user field and whatever is cooresponds to in your custom asset (perhaps ASSET_DATA_12.FIELD_46).
From there you can head over to create the custom ticket rule as defined above.