Scheduled task - authorization

Discussion in 'Site Programming, Development and Design' started by krastyokrastev, Dec 17, 2012.

  1. Hello Winhost team,
    I want to setup scheduled task to do some database processing. This task will be realized as a simple asp.net page. But I want to use optional password protection. How do I have to develop my task page? How Scheduled Tasks manager will pass protection username and password to my ASP.NET web application?
    Thanks in advance!
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    First you will need to be on our Ultimate plan because the Ultimate plan is the only plan that will offer the Schedule Task Manager.

    Once that is done you will code an asp.net page to connect to your website to query it and perform what ever you need on your database.

    After which you will password protect that file. Now, password protecting your file will be done through IIS Manager.

    Connect to our IIS server using this Knowledge Base article. Using the Microsoft IIS 7.0 Manager

    Then refer to this Knowledge Base article for some guidelines on how to password protect an object in your web root. Password protecting directories in IIS 7

    Now this Knowledge Base specifically is for subfolders, but believe it or not it can also be used on individual files.

    Here's how. Connect to our server using IIS 7 Manager. On the left hand side of IIS Manager expand the web service so you can see all the subfolders under the root. Then look to the very bottom of IIS Manager and find the little link settings that reads "Features View" and "Content View". Click on Content View. Now you can see the individual files. Right click on the target file and choose "Switch to feature view". From there you can use the Knowledge Base for password protecting the directory for steps to password protect the file. They are the same steps.

    Once you have the file password protected you can test it by calling it directly on your browser which should prompt a login Window in which case you input the user name and password. You will setup your Scheduled Task Manager to call on that file on a specific date and time, and input the user name and password in that scheduled tasks.

    Keep in mind that the User Name and password will be one of the additional FTP user names you created in the control panel. How to create an additional FTP user

    One thing I do want to bring up is that the modules in your IIS 7 Manager are elements in your applications web.config file. Thus you do not have to use the IIS 7 Manager to do this, but it is much easier unless you are used to coding your web.config files.
     
    Last edited by a moderator: Oct 14, 2015
  3. Hi Ray,
    And thanks a lot for your reply. We have ultimate plan. Now I will set what is needed as you explain the procedure.
    All the best!
    Krastyo
     

Share This Page