Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Scheduler Problem

Scheduler Problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpdatabasesecurityquestioncareer
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Suneet 03
    wrote on last edited by
    #1

    I am trying to create a scheduler using ITaskScheduler but I am struck up while running the job. I am able to create the job but it is throwing an error while saving the job at hr = pIPersistFile->Save(NULL,TRUE); The Error that is getting logged is The attempt to retrieve account information for the specified task failed; therefore, the task did not run. Either an error occurred, or no account information existed for the task. The specific error is: 0x8004130f: No account information could be found in the Task Scheduler security database for the task indicated. I am using XP , do anyone has any idea why it is failing while saving?

    M D 2 Replies Last reply
    0
    • S Suneet 03

      I am trying to create a scheduler using ITaskScheduler but I am struck up while running the job. I am able to create the job but it is throwing an error while saving the job at hr = pIPersistFile->Save(NULL,TRUE); The Error that is getting logged is The attempt to retrieve account information for the specified task failed; therefore, the task did not run. Either an error occurred, or no account information existed for the task. The specific error is: 0x8004130f: No account information could be found in the Task Scheduler security database for the task indicated. I am using XP , do anyone has any idea why it is failing while saving?

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Did you call IScheduledWorkItem::SetAccountInformation()?

      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze

      S 1 Reply Last reply
      0
      • M Michael Dunn

        Did you call IScheduledWorkItem::SetAccountInformation()?

        --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze

        S Offline
        S Offline
        Suneet 03
        wrote on last edited by
        #3

        Yes , i pass both the parameters username and password but the still same error exists. I went through the microsoft site , it seems this was a bug in earlier XP versions but that fix was made. I am using XP version 2002 service pack 2, is this the version in which fix is made or not? Thanx for reply!!

        1 Reply Last reply
        0
        • S Suneet 03

          I am trying to create a scheduler using ITaskScheduler but I am struck up while running the job. I am able to create the job but it is throwing an error while saving the job at hr = pIPersistFile->Save(NULL,TRUE); The Error that is getting logged is The attempt to retrieve account information for the specified task failed; therefore, the task did not run. Either an error occurred, or no account information existed for the task. The specific error is: 0x8004130f: No account information could be found in the Task Scheduler security database for the task indicated. I am using XP , do anyone has any idea why it is failing while saving?

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Can you create the job manually, and have it run?


          "A good athlete is the result of a good and worthy opponent." - David Crow

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          S 1 Reply Last reply
          0
          • D David Crow

            Can you create the job manually, and have it run?


            "A good athlete is the result of a good and worthy opponent." - David Crow

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            S Offline
            S Offline
            Suneet 03
            wrote on last edited by
            #5

            Yes, if i go to that job and specify the password in the properties, the job runs fine , its just that through setAccountInformation I am not able to run that job? It is picking my default Windows login and not the userID I specify in setAccountInformation. What could be the reason?

            D 1 Reply Last reply
            0
            • S Suneet 03

              Yes, if i go to that job and specify the password in the properties, the job runs fine , its just that through setAccountInformation I am not able to run that job? It is picking my default Windows login and not the userID I specify in setAccountInformation. What could be the reason?

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              How are you using the SetAccountInformation() method?


              "A good athlete is the result of a good and worthy opponent." - David Crow

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              S 1 Reply Last reply
              0
              • D David Crow

                How are you using the SetAccountInformation() method?


                "A good athlete is the result of a good and worthy opponent." - David Crow

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                S Offline
                S Offline
                Suneet 03
                wrote on last edited by
                #7

                This is the flow : hr = pITask->SetApplicationName(pwszApplicationName); TCHAR pszName[500] = "User"; TCHAR pszPwd[500] = "Password"; hr = pITask->SetAccountInformation((LPCWSTR)pszName, (LPCWSTR)pszPwd); hr = pITask->CreateTrigger(&piNewTrigger,&pITaskTrigger); hr = pITaskTrigger->SetTrigger (&pTrigger); hr = pIPersistFile->Save(NULL,TRUE); // Here Error is getting Logged in SchedLgU

                D 1 Reply Last reply
                0
                • S Suneet 03

                  This is the flow : hr = pITask->SetApplicationName(pwszApplicationName); TCHAR pszName[500] = "User"; TCHAR pszPwd[500] = "Password"; hr = pITask->SetAccountInformation((LPCWSTR)pszName, (LPCWSTR)pszPwd); hr = pITask->CreateTrigger(&piNewTrigger,&pITaskTrigger); hr = pITaskTrigger->SetTrigger (&pTrigger); hr = pIPersistFile->Save(NULL,TRUE); // Here Error is getting Logged in SchedLgU

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  What is the value of hr?


                  "A good athlete is the result of a good and worthy opponent." - David Crow

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  S 1 Reply Last reply
                  0
                  • D David Crow

                    What is the value of hr?


                    "A good athlete is the result of a good and worthy opponent." - David Crow

                    "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                    S Offline
                    S Offline
                    Suneet 03
                    wrote on last edited by
                    #9

                    hr = -2147216619 This is the value it gives while saving thru IPersistFile->Save

                    D 1 Reply Last reply
                    0
                    • S Suneet 03

                      hr = -2147216619 This is the value it gives while saving thru IPersistFile->Save

                      D Offline
                      D Offline
                      David Crow
                      wrote on last edited by
                      #10

                      I think that value resolves to SCHED_E_SERVICE_NOT_RUNNING.


                      "A good athlete is the result of a good and worthy opponent." - David Crow

                      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups