force start/reboot aspnet_state in scheduled task

Copper Contributor

I have a little problem with the "ASP.NET Server State" service, which does not restart when I "shutdown" from the task scheduler. I am therefore looking to plan a task to force the reboot, but ... I can't find the right arguments to force the reboot of the service.

 

How do I force the scheduled task to start the service "aspnet_state" ?

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_state.exe

1 Reply
To stop and start a service using a cmd and answering a yes/no prompt if needed:
net stop aspnet_state /y
net start aspnet_state

to do the same thing in a PowerShell script:

restart-service aspnet_state -confirm:$false -force:$true