Why won't my scheduled task work?

gib65

Member
Hello,
I'm trying to schedule a task in the Task Scheduler on Windows Server 2016. The task is to reset a website in IIS. It's supposed to run every 5 minutes.
Here is the action:
"appcmd.exe" start site /site.name:Default Web Site
This keeps giving me a 0x57 error.
I know that this works because I've verified it:
"appcmd.exe" start site /site.name:testsite
Therefore, it seems to me that the problem is with Default Web Site. I'm guessing appcmd doesn't know how to handle the spaces in the name. I tried this but this doesn't work either:
"appcmd.exe" start site /site.name:"Default Web Site"
Does anyone know how I would set the website to be restarted as the Default Web Site? Thanks.
 

beers

Moderator
Staff member
What are you working around that you need to bounce it every 5 minutes?

0x57 is for an invalid parameter.
 

gib65

Member
Ok fine, we're experiencing unexplained unresponsiveness from our web API. Every once in a while, it just doesn't respond. We're wondering if it's (for some reason) shutting down in IIS (Windows Server 2016). So I'm trying to schedule a restart of Default Web Site every 5 minutes in Task Scheduler. It worked on a test website (with no spaces in the name) but not with Default Web Site where our API is.

If you wanna ask more questions or if you have alternative solutions for me, by all means let me know... but in addition, can you please tell me (if you know) what's the correct syntax for the action in Task Scheduler? (i.e. "appcmd.exe" start site /site.name:[what?])
 
Top