cancel
Showing results for 
Search instead for 
Did you mean: 

Extension to Start, Stop, and Query Local and Remote Windows Services

SOLVED
Highlighted
Moderator

Extension to Start, Stop, and Query Local and Remote Windows Services

Please find ServiceManagerExtension.zip attached to this post. This JScript extension uses WMI to interact with local and remote Windows services. It was written as an example of what you can do with script extensions. Please feel free to open up the zip file, and dissect its parts. 

 

WMI requests are performed in the security context of the user that is running TestComplete. You should be a local system administrator if you intend to control local services. You will need to have the appropriate domain administrator permissions to modify service states on remote workstations.

 

Place the zip file in your "TestComplete 10\Bin\Extensions\ScriptExtensions" directory, and TestComplete should load it on startup. You will then find three new keyword operations in the miscellaneous section of the Operations panel: Start Service, Stop Service, and Get Service State.

 

The Operations panel:

opspanel.PNG

 

 

Drag one of the operations onto the keyword canvas, and you will get a user form asking you to specify details about the service that you are trying to interact with. 

 

The User Form:

opspanel.PNG

 

Check the box to target local services, or enter a remote computer name. When the keyword operation runs, the extension will attempt to interact with the service, and will record a TestComplete log message upon success, or an error upon failure.

 

You can also interact with ServiceManager from scripts using the ServiceManager object. The same threee methods are available:

ServiceManager.Start()

ServiceManager.Stop()
ServiceManager.GetState()

 

Each takes the same two input parameters: the service name, and the machine name. If the machine name is omitted, then the local machine is targeted.

 

Thanks,

Rick

 

SmartBear Customer Care

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Contributor

Re: Extension to Start, Stop, and Query Local and Remote Windows Services

Hi Rick,

 

Thanks for this tool. 

Can you provide information on how to use it when TestComplete is running in a domain computer but trying to start, stop or query a service in a PC which is not in the domain?

 

Cheers,

Leandro

View solution in original post

1 REPLY 1
Highlighted
Frequent Contributor

Re: Extension to Start, Stop, and Query Local and Remote Windows Services

Hi Rick,

 

Thanks for this tool. 

Can you provide information on how to use it when TestComplete is running in a domain computer but trying to start, stop or query a service in a PC which is not in the domain?

 

Cheers,

Leandro

View solution in original post

New Here?
Join us and watch the welcome video:
Building with the Collaborator API

Help Documenation
The Collaborator API is a JSON-RPC API that lets you integrate with Collaborator 9.0 and above. For more information about how the API works, check out the API description here:


Sample Plugins
For an example of an add-in that uses the API, take a look at the Microsoft Word Add-in for Collaborator:


We list all the great plugins our network has already built on this page on the SmartBear website.

Labels