Article ID: 2597817 - View products that this article applies to.
Expand all | Collapse all

SYMPTOMS

Consider the following scenario. You are attempting to stop the HTTP service on a server running Internet Information Services (IIS) 6, 7, or 7.5. The server also has the Microsoft Web Deployment Service (MSDEPSVC) installed. When you try to stop the HTTP service using the NET STOP HTTP command line instruction, the following error message is displayed in the command prompt:

The HTTP service is stopping.....
The HTTP service could not be stopped.


If you run the NET STOP HTTP command again, the following message is displayed:

The service is starting or stopping. Please try again later.



CAUSE

This problem occurs because the Microsoft Web Deployment Service (MSDEPSVC) depends on the HTTP service, but when the MSDEPSVC is initially installed that dependency is not registered with the Service Control Manager. When HTTP tries to stop, it needs to stop its dependent services as well. However, HTTP is not aware that it needs to stop MSDEPSVC due to the unregistered dependency and therefore the service stoppage fails.

RESOLUTION

To have us fix this problem for you, go to the "Fix it for me" section. If you prefer to fix this problem yourself, go to the "Let me fix it myself" section.

Fix it for me



To fix this problem automatically, click the Fix it button or link. Then, click Run in the File Download dialog box, and follow the steps in the Fix it wizard.


Fix this problem
Microsoft Fix it 50764


Notes
  • This wizard may be in English only. However, the automatic fix also works for other language versions of Windows.
  • If you are not on the computer that has the problem, save the Fix it solution to a flash drive or a CD and then run it on the computer that has the problem.

Then, go to the "Did this fix the problem?" section.



Let me fix it myself

To resolve this problem yourself, copy the following script and run it as a PowerShell script on the server. The script will ensure that all dependencies of the HTTP service are properly registered.



$bFoundHttp = $false
$msdepsvc = Get-Service -name MsDepSvc
$reqsvcs = "HTTP"
$msdepsvc.ServicesDependedOn | ForEach-Object `
{
    if($_.Name -eq "HTTP")
    {
  $bFoundHttp = $true
    }
    else
    {
    if($_.Name -ne "")
 {
     $reqsvcs += "/" + $_.Name
 }
    }
}
if ($bFoundHttp -eq $false)
{
    $status = $msdepsvc.Status
    if($status -eq "Running")
    {
 Stop-Service -name MsDepSvc
    }
    
    sc.exe config MsDepSvc depend= $reqsvcs
    if($status -eq "Running")
    {
 Start-Service -name MsDepSvc
    }
}


Did this fix the problem?

  • Check whether the problem is fixed. If the problem is fixed, you are finished with this section. If the problem is not fixed, you can contact support.
  • We would appreciate your feedback. To provide feedback or to report any issues with this solution, please leave a comment on the "Fix it for me" blog or send us an email message.

MORE INFORMATION

For information on how to install Windows PowerShell 1.0 on a Windows Server 2003 server, please see the following link:

Windows PowerShell 1.0 English Language Installation Packages for Windows Server 2003 and for Windows XP
http://support.microsoft.com/kb/926139




For information on how to use Windows PowerShell on Windows Server 2003, Windows Server 2008, and Windows Server 2008 R2, please see the following link:

Windows PowerShell
http://technet.microsoft.com/en-us/library/bb978526.aspx




For more information on the Microsoft Web Deployment Tool, please see the following link:

Web Deploy 2.0
http://www.iis.net/download/WebDeploy

Properties

Article ID: 2597817 - Last Review: October 11, 2011 - Revision: 8.0
APPLIES TO
  • Microsoft Internet Information Services 6.0
  • Microsoft Internet Information Services 7.0
  • Microsoft Internet Information Services 7.5
Keywords: 
kbfixme kbmsifixme KB2597817

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com