Remotely Controlling AOS services

I’ve recently moved into an environment with multiple load balanced AOSs that need to be controlled during code deployment and maintenance. If one needs to stop and start these services include either to logging into each machine individually or using the Windows services control panel to connect to the indivual machines to shutdown each AOS service.

Both of these options unfortunately are rather tedious and time consuming especially if you have numerous services to control and need to do it quickly. A simple way to do this is to batch/script the process using command line instructions to control the remote services. You can use sc.exe application to do so. Here are some examples:

sc \\[SERVERNAME] stop [SERVICENAME] e.g. sc \\JH-Srv-01  stop AOS60$01
sc \\[SERVERNAME] start [SERVICENAME] e.g. sc \\JH-Srv-01  start AOS60$01

This will issue the commands but won’t necessarily wait around while the services are stopping or starting.
Adding multiple of these commands to a single .BAT file will make you environment management life much easier! You can also use it to control other services like SSRS etc…

Note 1: You will obviously need the necessary permissions on each of these servers to do these tasks.
Note 2: The service name is the name listed under the properties (right click on the service, click properties) of the service not the one in the list of services.




3 thoughts on “Remotely Controlling AOS services

  1. Start-AXAOS, Stop-AXAOS and Restart-AXAOS from the community Powershell module supports remote machines from the beginning. You don’t have to know server name or AOS ID, you simply provide an AX configuration (e.g. Restart-AXAOS “PreLive”).
    It’s not designed for clustered AOS servers, but if you need it, consider extending the module. That’s why it’s open source.

    • Awesome thanks Martin. Do you perhaps have some additional links for this? Also are you able to control other peripheral services. I’m always looking for ways to make life a bit easier and better.

      • Sure. Probably the best source (except source code) is introduction and examples on my blog. You can see it was written in 2011, but it haven’t changed too much. I added only a few things, such as the support for AxBuild (and did rather poor job documenting these changes :-)).
        I would did some things differently today, but I think it’s not worth introducing changes that could break somebody’s scripts.

Leave a Reply to Martin Dráb Cancel reply

Your email address will not be published. Required fields are marked *