![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Stop-Service cmdlet Hi, I tried to stop the IIS Admin service using the Stop-Service cmdlet but it is telling me that I need to use the -force switch to do so because it has dependant services. However, the dependant service W3SVC is not running, so I would have expected this error message to appear only in case W3SVC is running. For instance, the net stop command asks to stop the dependant service only if it is running, otherwise it just stops the service. Is this behaviour by design? I find it at least weird (if not broken). Regards Joachim PS C:\> spsv iisadmin Stop-Service : Cannot stop service 'IIS Admin (IISADMIN)' because it has dependent services. It can only be stopped if the Force flag is set. At line:1 char:5 + spsv <<<< iisadmin PS C:\> gsv iisadmin | fl Name : IISADMIN DisplayName : IIS Admin Status : Running DependentServices : {W3SVC} ServicesDependedOn : {RPCSS, SamSS} CanPauseAndContinue : True CanShutdown : True CanStop : True ServiceType : Win32ShareProcess PS C:\> gsv w3svc | fl Name : W3SVC DisplayName : World Wide Web Publishing Status : Stopped DependentServices : {} ServicesDependedOn : {IISADMIN} CanPauseAndContinue : False CanShutdown : False CanStop : False ServiceType : Win32ShareProcess PS C:\> net stop iisadmin .. The IIS Admin service was stopped successfully. PS C:\> gsv iisadmin | fl Name : IISADMIN DisplayName : IIS Admin Status : Stopped DependentServices : {W3SVC} ServicesDependedOn : {RPCSS, SamSS} CanPauseAndContinue : False CanShutdown : False CanStop : False ServiceType : Win32ShareProcess |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Stop-Service cmdlet Joachim Meyer wrote:
post the link back here. If enough people find it to be an issue, then Microsoft will likely address it in a future release. Personally, I don't see this as a big issue myself. Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Stop-Service cmdlet "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote:
behaviour of some of the cmdlets. In general, I like the PowerShell very much but with some cmdlets I would have wished that they more closely model the behaviour of existing commands you are already used to. Joachim | ||||||||||||||||||||||||||||||||||||
| | #4 (permalink) | ||||||||||||||||||||||||||||||||||||||||||||||||
| Guest | Re: Stop-Service cmdlet Hi All, I came across this issue a long time ago using VBScript. I think you may find that there are other dependent services that you have to stop. IISRESET performs three stop/starts, equivalent of: Stop-Service "W3SVC" / "World Wide Web") Stop-Service "SMTPSVC" / "Simple Mail Transfer Protocol (SMTP)") Stop-Service "IISAdmin" / "IIS Adminstration") So try this approach. Good luck, Ben "Joachim Meyer" wrote:
| ||||||||||||||||||||||||||||||||||||||||||||||||
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| get-service cmdlet in powershell v2 (ctp) | RG | PowerShell | 3 | 12-14-2007 03:43 PM |
| How is it possible to execute start-service and stop-service through a Web-interface? | Alexander Vasilevsky | PowerShell | 7 | 11-15-2007 08:29 PM |
| Pipeline stop-service with -force | Julian Bowker | PowerShell | 12 | 07-06-2007 07:30 AM |
| which service can stop at VISTA? | ·ëèë | Vista General | 6 | 01-24-2007 01:17 AM |
| NET START STOP Service Command Line | Dr. Network | Vista General | 3 | 09-26-2006 09:17 PM |