Ask the Community
Groups
Clear Pending Procedures in the VSA - Connect IT Community | Kaseya
<main> <article class="userContent"> <h3 data-id="question">Question</h3> <p>How do we clear any agent procedures that are currently pending to run on all VSA agents?</p> <h3 data-id="answer">Answer</h3> <p><strong>Step 1 </strong></p> <div>Download the following procedure by clicking here <a href="/home/leaving?allowTrusted=1&target=https%3A%2F%2Fkaseya.vanillacommunities.com%2Fkb%2Farticles%2Faliases%2Fkaseya%2Fhc%2Farticle_attachments%2F4404040506769%2FClearPendingProcedures.sql" rel="undefined nofollow">ClearPendingProcedures.SQL</a> </div> <p><strong>ClearPendingProcedures MD5 Hash: 4d828a98800645e47ec0d1860f153a86</strong></p> <p><strong>Step 2</strong></p> <p>Place the file on your SQL server Desktop or other similarly accessible location on the server</p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/NGX8PUJLR40Y/desktop.png" alt="Desktop.png" class="embedImage-img importedEmbed-img"></img></p> <p><strong>Step 3</strong></p> <p>Double click or "open" the file, this should launch SQL Server Management Studio click "connect" to authenticate.</p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/U374EXIFOT1W/mceclip2.png" alt="mceclip2.png" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p><strong>Step 4</strong></p> <p>Click "Connect" and Execute the script:</p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/UBLS6CG4YLZY/mceclip3.png" alt="mceclip3.png" class="embedImage-img importedEmbed-img"></img></p> <p>You should see the following message: </p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/R6OBUOX0CQU3/mceclip4.png" alt="mceclip4.png" class="embedImage-img importedEmbed-img"></img></p> <p><strong>Step 5</strong></p> <p>Open a "New Query" window: </p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/Y78E6LH7UGGK/mceclip5.png" alt="mceclip5.png" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p>And run the following command</p> <pre class="code codeBlock" spellcheck="false" tabindex="0">exec [dbo].[clearPendingProcedures]</pre> <p> </p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/JY560R205J0A/mceclip6.png" alt="mceclip6.png" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p><strong>NOTE: </strong>This may take a long time to execute, in some cases hours. </p> <p><strong>Step 6</strong></p> <p>Run the following Query:</p> <pre class="code codeBlock" spellcheck="false" tabindex="0">delete from scriptAssignment<br>where execscripttime < getdate()<br>and eventinstanceid = 0</pre> <p><strong>Step 7</strong></p> <p>Run the following Query</p> <pre class="code codeBlock" spellcheck="false" tabindex="0">update scriptAssignment set inProc = 0 where inProc = 1</pre> <p> </p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/EK87FRLXORXC/mceclip0.png" alt="mceclip0.png" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </article> </main>