Personal tools
You are here: Home Process Manager email owners of missing machines

email owners of missing machines

by jack — last modified 2009-06-26 17:43

Send an email to owners of missing machines

This builds on the concept in Report machines that aren't scanning any more, but also allows you to contact the user directly (assuming that you have Active Directory and that Primary Owner is filled in).

  • Create a new process named Out of Date Inventory.
  • Drag in a Get/Set Directory Information Object and link the lightning bolt to it.
  • Drag in an Email and link the checkmark to it.
  • Right-click the Lightning bolt and select Event Listener, New
  • The event listener we want is a Database Listener:
  • Select Query SQL is select COMPUTER_IDN,DEVICENAME,PRIMARYOWNER,LASTUPDINVSVR FROM computer where hwlastscandate >= GetDate()-30 and deviceid != 'Unassigned'
  • Click Get database columns event listener
  • update SQL is select COMPUTER_IDN from COMPUTER where COMPUTER_IDN={|COMPUTER_IDN|} -- note that it doesn't care if we're actually updating, it just wants to have something to do. We don't mind repeat notifications, and we're going to use the frequency of the event listener to control volume of emails.
  • On the Mapping tab, Set External Unique System Identifier to COMPUTER_IDN and set Requester to {|PRIMARYOWNER|}.
  • Click the Autogenerate field mappings button -- if you don't, you'll have to create your own definitions for those four database columns in Configure > Fields.
  • Even after doing the Autogenerate, you still need to create one last field definition for the Primary Owner's Email Address: Configure > Fields > Out of Date Inventory Scans > New Field, General type, do not do Event Listener Mapping for that field.
  • Leave the Details tab alone for now, that's the last step.
  • Save the Listener and go to Configure > Email Templates, then create a new Email template to send an alert to your end users. Something like this:

Hello,
<br><br>
It has come to IT's attention that your device {|DEVICENAME|} has not been turned on since {|LASTUPDINV|}. Please connect it to the network and turn it on, so that it may be inventoried and patched.
<br><br>
If you are no longer responsible for {|DEVICENAME|}, please contact the help desk for assistance.
<br><br>
Thank you,<br>
Friendly Neighborhood Helpdesk.

resulting email

Finally, we'll finish the process.

Set the Get User Data object up as follows:

Attribute Action: Get  attribute value
Attribute Name:   Mail
Attribute Value:  LEAVE THIS BLANK
Connection:       Your AD server
User Name:        Field > Workflow > Requester (or Primary Owner, should be the same value)
Results:        Field > Out of Date Inventory Scans > Email Address
get email address

Set the Email object up to email the template to Workflow Requester; do not do Notification.

email object

Validate and save the workflow.

Right click the lightning bolt and manually start the workflow with a test record; when you're happy, set up the Event Listener details page to run every few days.

Bonus Points

Put a Decision before the Get/Set Active Directory Information object; set a condition that checks if the primary owner is like your directory. If Yes, continue to ask the password. You'll get an exception if you ask Active Directory for the email address of a local  account or non-account like loginwindow or SYSTEM. So if the Decision comes back No, you should do something else.

decision to go to ad


Extra Super Bonus Points

You'll need DBA help for this... Instead of using the Computer table, regularly copy the relevant columns to another table (note that it doesn't have to be in the LANDesk database, any database that LPM can reach via ODBC will do). Add another column, type INT, named CONTACTS. Put an Update in your Event Listener that increments that value (something like UPDATE mytable SET CONTACTS = CONTACTS + 1). Add a Contacts field, and put decisions into the process along the lines of "If Contacts > 3, lookup the user's manager and email them too".

Server Says:
Take your work seriously but never take yourself seriously; and do not
take what happens either to yourself or your work seriously.
-- Booth Tarkington
Safety First!
203 Days without a Dumpster fire.
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: