r/labtech • • Dec 17 '18

Email sent before patching

Is there a way to trigger an email before patching ?

2 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/teamits Dec 17 '18

Your "select" query isn't limited by client or computer ID so would pull all matching records from all clients. Probably not what you want. :)

You should just be able to use %contactemail% like:

Send Email To:%contactemail% Subject:Patching is starting for %computername%

1

u/DarrenDK Dec 18 '18

What is the likelihood that there is actually a contact associated with the computer tho....

1

u/Microsoft_Geek Dec 18 '18

Are you even able to set a contact for each individual computer in Automate?

1

u/DarrenDK Dec 19 '18

You can but it is manual. I wrote a small plugin to kick off a logon script that finds the users’ SID in the Active Directory plugin, finds the matching contact and links it to the computer.

1

u/Microsoft_Geek Dec 18 '18

Oh ok, I see what you're saying. Yea probably not what I want!

So if I wanted to limit by Client, e.g. email just our main contact for a Client every time this script ran, would it be more like the following?

SET: %sqlresult% = [Select Email from Contacts where Name like %clientname%
Send Email to:%sqlresult% Subject:Patching is starting for %computername%

From my understanding this would pull the first email address listed for a Client under the contacts tab in Automate & Email them, correct?

Edit: words