Kaseya Community

Kaseya Agent procedure Registry check Help

  • I need to do a procedure that will check the registry and if the key is there that it will as the user to reboot before the agent procedure runs. See this article http://www.sophos.com/en-us/support/knowledgebase/108105.aspx. I have made a installation procedure for this software but if this key is there it stops the installation and kaseya says that it ran with no problems. I need to perform a registry check before so if this key is there it will as them to reboot before it installs the software. I need to know how I can do this.

  • There are sample scripts that come loaded in the VSA that Nag Reboot.

    You can have your registry check script kick off this script as a child script if the registry entry is present.

    Or simply look at the Nag Reboot script and re-write the steps into your registry check script.

  • I have tried doing the getregistry/value/64bit and nothing seems to work. File path is HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session_Manager\PendingFileRenameOperations

  • Have you tried getRegistryValue() HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session_Manager\PendingFileRenameOperations\ Exists ?? With the last "\" ??

  • I have tried that it and nothing happens.

  • is there an "_" between Session and Manager in the key you are looking for? I just checked mine and there is no "_"

  • You could also add a sqlRead option in your Agent Procedures using the following Select Query to get the Reboot Pending Status;

    SELECT rebootPending FROM patchStatusTotals WHERE agentGuid='+++GETVARGUID:'

    And the Values that you want to check for with a checkVar If Statement are;

    0 = No Pending Reboot

    value greater than 0 =  Pending Reboot (e.g.: 1,2,3,4 etc...)



    updated
    [edited by: HardKnoX at 6:55 PM (GMT -7) on Jul 3, 2014]
  • There is in the regedit there is a space. This is what I'm doing and I don't know if it matters it I try 64bit or 32bit regkey. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SessionManager\PendingFileRenameOperations

    I have tried these options too:

    1-HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations

    2-HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SessionManager\PendingFileRenameOperations\

    I don't really know what sqlread I have tried that but I had to restart the computer so maybe that is why that one does work. I just created the regkey to test after the restart.

  • Using GetVariable(64-Bit Registry Value) and

    1-HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations

    Works for me.  Name the variable and do a sendMessage() to your screen with that variable in the message to see what it is finding.

  • Procedure regtest.xml

    64 or 32 bit simply means if its going to check inside Wow6432Node or not.

    Make sure you select the correct one.

    As per the select statement on the pending reboot for patch statuses... this is great BUT if your patch management setup is not in actual working order/up to date, then this value will become invalid as this VSA variable will only change once the Automatic Updates/Initial Updates run and update the patch status fields.

    Looking at your original question the SQL Query will not be the best way to go about this.

    The check requires GetRegistryCheck with this as the Value string:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations

    Since it is looking up the HKLM either 64 or 32 bit version of the procedure will work as the Wow6432Node is only held within the HKCU.

    Make sure that there is a space between the word Session and Manager, no backslash at the end.

    Attempt to re-create the Registry Entry on your local end point and write the procedure to check. They both work, and you can test by writing in a Write AP Log Entry to validate the test.

    I attached the AP I wrote for this simple test.