Jump to content

Check if Service on Remote Server is Stopped


Recommended Posts

Hi,

I need you help with a script I'm writing. I need to stop a service on on of my servers (that part is working) and then need to make sure the script only continues once the service is stopped.

I would like to avoid SLEEP

I was trying something like this juts to get you an idea:

Do
    Sleep(100)
Until $oShell.ServiceStop(spooler)

Problem is, ServiceStop doesn't work that way and I have no idea how I would do this on a remote server.

Any idea or suggestion would be highly appreciated.

Thanks

Aron

 

Link to comment
Share on other sites

  • Moderators

Moved to the correct forum, as the DEV forum very clearly states

Quote

Do not create AutoIt-related topics here, use the AutoIt General Help and Support

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

What COM object is $oShell using?  ...assuming shell.application

You could use the command-line exe SC to work with remote (or local) services.  Be sure that the account you are using has rights on the remote machine.

Edited by spudw2k
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...