Skip to main content
Todd in Italy
Inspiring
April 2, 2024
Frage

Account for scheduled tasks in a Windows environment

  • April 2, 2024
  • 2 Antworten
  • 1925 Ansichten

Kind of a dumb question, but I can't find this in the documentation. I inherited an old ColdFusion server with several existing scheduled tasks. I rebuilt the server from scratch, and imported the scheduled tasks, which run on a user account "taskrunner." My question is where should I put this account? Does it need to be a local user account on the IIS server that hosts ColdFusion, or is there somewhere in ColdFusion where I need to create/define this account? I am a bit confused becuase the old server does not have a local account with the name "taskrunner" yet the tasks were running before the rebuild, and do not run now. Clearly the account must be created somewhere, but where?

    Dieses Thema wurde für Antworten geschlossen.

    2 Antworten

    Charlie Arehart
    Community Expert
    Community Expert
    April 3, 2024

    To your last comment, your screenshot offered there shows you referring instead now to the "user name" field in setting up a cf scheduled task. To be clear, that is info about providing authentication for running the url offered in the scheduled task, if such auth would be required by the web server serving that url.

     

    Again, though, that would have nothing to do with any cf admin username nor is it the "account under which the task runs" (in the sense I initially thought you were referring to). On the latter point, I suspect we're just differing in semantics. The first points in my reply here seem to resolve the confusion I had regarding your wording.

     

    And what matters most is if your problem is resolved. It sounds like you feel you won't know until a cf restart. Again, to me that should have no bearing on your changing the username field in a task, nor in running it. But let's see how things play out for you. 

    /Charlie (troubleshooter, carehart. org)
    Todd in Italy
    Inspiring
    April 3, 2024

    Thank you, Charlie, but now I am more confused. The question remains... for the account shown in the scheduled task set up page I posted, where do I recreate that account so that the job will run?

    Charlie Arehart
    Community Expert
    Community Expert
    April 3, 2024

    The only three possibilities I can think of are: 1) within the CF application. That is not the case because the account data is carried over with the SQL restoral, like all the accounts for the actual application, and it did not come over when I restored the database, so it is not an application account. 2) a local account on the IIS server. I checked the old server where it was working, and there is no such local account. 3) within ColdFusion. That seems likely, but the only place to put an account in CF is in the administrator account creation portion, which I have done, but it did not yet work (will find out after a restart). 
    Is there anywhere else it could be? Surely setting up an account for scheduled tasks is a fairly standard operation for ColdFusion, but the documentation just says to enter the account name and password. It does not tell me where this account is stored or how to recreate it (or it's too difficult for me to find).


    Todd, you need to take a breath. 🙂 It seems your head is spinning at possibilities. The answer is likely "none of those 3". But we can get to your answer. 

     

    Please reconsider my first paragraph in my answer you're replying to. I said that the user name field you're referring to is "about providing authentication for running the url offered in the scheduled task, if such auth would be required by the web server serving that url.".

     

    Let's cut to the chase: take that url shown in the scheduled task and run it in a browser. Since it's a localhost url, run it on a browser on the machine running cf. What do you get? Do you get a prompt for a username and password? If you don't, then none is needed, it seems. Then I'd ask what has led you to pursue all this, as cf's providing one in the task would be ignored by the web server. 

     

    More important, can you still access the old server you are comparing to? What if you run the same url there (In a browser on that machine)? If it's a different response, then the point is the web server there is configured differently. 

     

    As for what web server it may be you mention iis. Is that used on both machines (old and new)? I see the url for the task shows having no port indicated, and is using http, so running by default on port 80. That likely means that Cf is NOT the web server running this request, so we can take cf out of the running. (I don't mean to say cf is not RUNNING the request. I mean some other web server is likely receiving the request, and doing the authentication, and then handing the request onto cf--if indeed the end of your blacked out url is a cf request)

     

    Let's hear what your testing shows before we guess at any more possibilities. 

    /Charlie (troubleshooter, carehart. org)
    Todd in Italy
    Inspiring
    April 2, 2024

    I found the answer. The account is created within ColdFusion, after enabling multi user for the administration of CF. 

    Charlie Arehart
    Community Expert
    Community Expert
    April 2, 2024

    If that is indeed the correct answer, it may help you and readers to assess how you'd posed the question. To be clear, by your adding a new user in the admin, that controls only the ability to login to the admin with that different username (versus the default "admin").  And when one does that, it control what admin pages that admin user SEES.

     

    But to be clear it doesn't have anything to do with "what account the task runs under": that would be the account running cf itself (as set in the service running cf). 

     

    I don't know if those distinctions will be helpful to you or others, but they seemed to be clarifications that might be appropriate. 

    /Charlie (troubleshooter, carehart. org)
    Todd in Italy
    Inspiring
    April 3, 2024

    Charlie,

    I am referring to the user name entered when setting up scheduled tasks, as shown in the attached screen shot. This account name should be an account created somewhere.... either in the OS as a user, or in CF as a user. The question is where should I create the account to match this user name?

    Thanks,

    Todd