1 Reply Latest reply on Nov 18, 2009 9:23 AM by gashby

    How do you delete an orphaned schedule task?




      I am having an issue whereby a deleted scheduled task is still running, i am unable to stop it as it is not appearing in the list of scheduled task in the console.


      When i look on the client the following schedule task appears to have run:


      c:\Program Files\LANDesk\LDClient\sdmcache\landesk\files\SDClientTask.servername.235.xml


      However when i right click on the same PC under "All Devices" in the console "Scheduled Tasks and Policies" the scheduled task does not appear in the list.


      Some how it appears that the task has become orphaned in the database and i need to delete it, can anyone advise how this can be accomplished.




        • 1. Re: How do you delete an orphaned schedule task?

          Troubleshooting this is depends on if this guy is a push or policy (or policy supported push). In the event that this is a policy, there are some cases where the policy gets put down on the client by running policy.sync. Once policy.sync picks it up it gets put in the database. There have been some instances where even though a task is deleted from the console it doesn't get deleted from the client's database. So, if this is the case you can either look at the client database and delete the rows that refer to the task in the client database (see http://community.landesk.com/support/docs/DOC-5940 for more information on that) or you can simply run a script that does this for you (see below).


          Here is a popular script that does the trick nicely:

          cmd /c del "c:\documents and settings\all users\application data\landesk\managementsuite\database" /q
          del "C:\Documents and Settings\All Users\Application Data\LANDesk\ManagementSuite\landesk\files" /q
          del "C:\Documents and Settings\All Users\Application Data\vulScan\*.xml" /q
          del "C:\Program Files\LANDesk\LDClient\sdmcache\landesk\files\*.xml" /q
          net stop "Landesk Policy Invoker"
          "c:\program files\landesk\ldclient\clientdbutil.exe" /create
          "c:\program files\landesk\ldclient\clientdbutil.exe" /validate
          net start "Landesk Policy Invoker"
          "c:\program files\landesk\ldclient\policy.sync.exe"
          "c:\program files\landesk\ldclient\policy.client.invoker.exe"
          EXIT /B 0



          However, before for you go through that trouble verify that the task is indeed out of the database (the core's database that is). You can do this by going into SQL and opening up query analyzer and running the below SQL statement:


          SELECT * FROM LD_Task WHERE Task_Idn = 235


          The Task_Idn will vary from task to task, so in other tasks you can just look at the task ID and that will equal your task_idn. One thing to note is that you can't just go delete this row from the ld_task table, as there are several dependent tables. If this does indeed turn out to be a case of an orphaned task I will post a script to remove the task.


          Let us know how you make out.