Ask the Community
Groups
Agent Procedures - Execute User Command. - Connect IT Community | Kaseya
<main> <article class="userContent"> <h3 data-id="question"><strong>QUESTION</strong></h3> <p>What does the "execute as user" command means and what it is used for? </p> <h3 data-id="answer"><strong>ANSWER</strong></h3> <p>The Execute as user command means that the command will execute as the current logged in user. For example, if a local user named <strong>test01</strong> is logged in and the cmd command "whoami" is run, it would return <strong>test01</strong> as the user.</p> <p dir="auto">This command runs with <strong>user-based</strong> <strong>permissions</strong>, meaning that it depends entirely on the user access rights. It is recommended to use the <strong>"Use Credentials"</strong> command in the case of limited user rights. </p> <p dir="auto">Execute as user command, would allow the user to run a program/command as <strong>any user</strong>, for example, a domain admin user or local admin user could be impersonated to run any command requiring admin credentials.</p> <p dir="auto">In case that an agent procedure needs admin access rights to be granted by the user, the VSA will hide the popup window asking for it, so this command will grant those rights by default, avoiding the procedure to stall and fail.</p> <p dir="auto">On the other hand, if the machine is on, but no user is logged in, the command will run as <strong>nt authority\system </strong>allowing the procedure to run successfully.</p> <p dir="auto">In order to test these observations, the user can use the cmd command <strong>whoami</strong> in conjunction with the <strong>executeshellcommandtovariable</strong> and <strong>writeprocedurelogentry</strong> commands.</p> <p dir="auto"><img src="/attachments/token/bpoKH1XVsqNUJSR89bp5sQRSJ/?name=inline1780165371.png" alt="image" class="embedImage-img importedEmbed-img"></img></p> <p dir="auto"> </p> <p dir="auto"> </p> </article> </main>