Stop Application pool without elevated rights
Hi all, I need to create a script that will alter the database used by my website, The script will be scheduled and executed by the SQL Server Agent. As part of this script I will need to stop the application pool or website, complete my database alterations and then restart the pool/website. Recycling the application pool after the upgrade maybe sufficient. Is there any way to complete this without running this script with elevated rights? The two things that I do not want are, to have to manually stop/restart the pool/website or to have the elevated rights in clear text in a script. Thanks in adance for your help.
June 18th, 2012 7:38pm

Hi, Since disabling UAC would require a reboot, the script based change would not be helpful for only temporary disabling UAC. What happens, if you run the batch as Scheduled Task with appropriate permissions? You could start this with schtasks.exe. Best regards Elytis ChengElytis Cheng TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
June 19th, 2012 12:07am

Thanks for the reply, As this change is required to run via SQL Server Agent, schedule tasks will not be usable. It would be better to use an encrypted Stored Procedure rather than running a scheduled task on demand and once encrypted there is no way to decrypt it. At least this way everything is maintained in one location and doesn't require extra resources to complete the upgrades. Not sure if it is possible to run cmdshell from SQL with elevated rights. This double layer of security (UAC) is painful. If a Domain Admin has rights to run a process why is it then still required to be run as an administrator. Start with systems being locked down and open up processes as required even for Domain Admins. The double layer of security should be applied when granting an account access to something not at run stage.
June 20th, 2012 12:59am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics