Saturday, January 29, 2011

Remotely stopping services

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

  • 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?

    dmckenna : Can you explain why sc.exe is so slow?
    dmckenna : powershell script works much faster
    From Jim B

0 comments:

Post a Comment