Kaseya Community

Determine how agent procedure was run

This question is answered

Is there a way to determine if an agent procedure (v6.2) has been run by a user who clicked Run Now in Live Connect vs. by an admin scheduling the procedure to run?

I want to differentiate because I want to use Send Message confirming that the script completed if a user runs it themselves, but want to exclude the pop-up message if it is scheduled by an admin.

Thanks,

Ashley

Verified Answer
  • The numbers that you are seeing returned when a procedure is initiated via Live Connect is the machine GUID. You could compare the #adminDefaults.adminName# and #vAgentLabel.agentGUID# by using and If Statement for Check Variable to compare the 2, then display a message for the end user. I just tested this, and it worked great.

All Replies
  • Hi Amilun

    You can check the Agent Procedure log to see who scheduled/run the procedure.

    There is a variable called #adminDefaults.adminName# that stores the name of the VSA user who scheduled the agent procedure. You could potentially use it to determine if you send the message or not. See the "Automatic Administrator Variables" section in help.kaseya.com/.../2855.htm for more details.

    Regards

    Amado Hidalgo

    Kaseya Support

  • I tested this and I see how it works, but I have a follow up question.

    I see that the adminName contains only numbers when it is initiated via Live Connect and it has a real username when initiated by an admin. Is there an easy way to do any regular expression type string comparison to differentiate between these? I tried to use Check Variable with Greater Than 0, expecting that strings with no numbers in them would evaluate to 0 but unfortunately they always result in True.

  • The numbers that you are seeing returned when a procedure is initiated via Live Connect is the machine GUID. You could compare the #adminDefaults.adminName# and #vAgentLabel.agentGUID# by using and If Statement for Check Variable to compare the 2, then display a message for the end user. I just tested this, and it worked great.

  • Thanks. That works perfectly.