Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Normally after running Windows updates there are a few servers in our infrastructure that our monitoring software (SolarWinds) shows as having problems. Normally this is flagged as being the netman service not having started. to rectify I normally log in to the server and restart the Netman service (and if that hasnt shifted the error the winmgmt and snmp services as well). I absolutely know there must be a bertter way to do this.

I have looked at powershell but running the following yields no change in the service:

Get-Service -ComputerName XFILES -Name netman | Restart-Service -Verbose

Even if I add "-Force" to the command all I get is the repsonse of it performing the restart but the service never actually restarts.

I have also looked at psservice but this seems to struggle again with dependancies though it works very well for lone wolf services. Am I destined to have to write full on script that will enumerate dependent services or am I missing a super simple way of achieving this?

share|improve this question
    
I'd better look deeper in a rooctause, why the service fails to start. Check HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Netman\Parameters registry key and make sure the entry ServiceDll REG_EXPAND_SZ %SystemRoot%\System32\netman.dll exists. If Not, create it –  Volodymyr Apr 12 '13 at 9:28
    
its more a problem with the monitoring software. the service has started but for whatever reason our implementation of solarwinds does not see the service as up. restarting the service and repolling the node in solarwinds clears the warning. Probably not best practice I agree. I have double checked though and that reg key does exist. –  Tim Alexander Apr 12 '13 at 10:01
    
Does this happen to only one service? Have you tried to change poll interval for this service? –  Volodymyr Apr 12 '13 at 10:03
    
It is normally only the netman service that fails to show as being up. The default polling and timeout are set on the application monitor (300 seconds). Repolling without restarting the service does not clear the "down" status. –  Tim Alexander Apr 12 '13 at 10:09
1  
Tim, have you tried using the WMI method to restart the service? something like $Srv = gwmi win32_service | where {$_.name -match "WinRM"};$Srv.StopService();$Srv.StartService(). I've had issues too with using the cmdlets especially on remote machines but using the WMI methods seem to work okay. –  BigHomie Apr 12 '13 at 20:15

1 Answer 1

You could pause before starting the service again:

Stop-Service "my service" -Verbose; Start-Sleep -Seconds 30; Start-Service "my service" -Verbose
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.