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.

I have been using sc.exe to remotely stop a bunch of custom windows service(s) as part of our product deployment script. This was working perfectly until we migrated from windows 2003 to windows 2008 r2. Now no matter what you do query, stop, start etc it takes about 20 to 25 seconds to respond. There are 10 servers (8 virtual and 2 physical). It takes approx 20 ish seconds on physical and virtual servers.

The problem mainly is that my production deployments have gone from about 12 sec per environment to over a minute.

Just wondering if there are specific ports that may need to be opened on win 2008 firewall to allow the process to speed up or is there any specific permission required.

Note: It does work. It is just very slow.

Regards,

David

share|improve this question
    
are you still running the scripts from an w2k3/xp or are they running from a w2k8r2/win7? Also if you do the equivalent task local to a w2k8r2 server does it still take 20-30 sec's? –  tony roth Sep 6 '10 at 22:57

1 Answer 1

up vote 0 down vote accepted

have you tried something like:

(gwmi -query "select * from win32_service where name='serviceiwanttostop'" -computer remoteserver).stop

from a powershell prompt to see if that's any faster?

share|improve this answer
    
Can you explain why sc.exe is so slow? –  dmckenna Sep 7 '10 at 8:17
    
powershell script works much faster –  dmckenna Sep 8 '10 at 14:27

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.