Microsoft SharePoint Foundation Web Application service stuck on Starting/Stopping

There are situations where you like to start ‘Microsoft SharePoint Foundation Web Application service‘ on one or more of you application servers. Reason can be anything.

Any server running ‘Microsoft SharePoint Foundation Web Application service’ is considered as a web server by most of the 3rd party vendor. For some products licensing is based on number of web front end servers. In that case, if you start this service, this machine is consider a web front end even though it is not available directly for users. In most of the cases, you can talk with 3rd party vendors and convince them about licensing and purpose of starting this service in application server.

Some of the reasons why usually admins do this was for search indexing, to run central administration or while troubleshooting a website.

If you try to start this service in any server in an already existing farm with considerable number of web applications and content, it takes sometime to start. Yes, it may take more than an 1 hour in some case. Once you start this service, you should see some changes in IIS. Application pools and sites will start showing up in IIS. This process may complete in less than 5 mins or may take more than 1 hour. As long as you see some activity in IIS, you dont have to panic!

If you feel more securing waiting while running a STSADM command, here it is

Start the service:

stsadm -o provisionservice -action start -servicetype spwebservice

Stop the service:

stsadm -o provisionservice -action stop -servicetype spwebservice

Once you start the command, wait until it comes back with something.

Same will be the case while turning off this service. All the application pools and sites are removed from IIS.