none
Possible to use VBScript to restart the service that launched the script?

    Question

  • Hi,

    Hopefully I'm explaining this correctly. I'm using Altiris Deployment Solutions 6.9 SP4, to manage XP and Windows 7(x86 & x64) machines. What I'm trying to do is launch a script on a remote machine (via Altiris) that will restart the Altiris service. The problem I'm running into is that the script is launched by the Altiris service on the remote machine, and once it does it's first step (stop the service) it kills the script. At least, that's the only explanation I can think of as to why the script isn't successfully completing.

    I should mention that I'm *completely* new to VBScript. I'm being trained in my current position so scripting is not something I was doing before I came to my current position. Any help you guys can provide would be greatly appreciated. If you need any other info please let me know. Thanks,

    JR

    JR.Hine@live.com

    Thursday, January 17, 2013 5:45 PM

Answers

  • Hi,

    I'm not an Altiris admin, but it seems to me you need to think through the logic a bit: The service starts the script, which then stops the service. It seems to me that stopping the service would then terminate the script that stopped the service.

    This sounds more like an Altiris support question. Why do you need to restart the service on client machines? If there's a problem with the client service on client machines, it seems to me that you should address it with Altiris support.

    Bill

    • Proposed as answer by jrv Thursday, January 17, 2013 6:33 PM
    • Marked as answer by Bill_StewartModerator Wednesday, February 06, 2013 10:11 PM
    Thursday, January 17, 2013 5:54 PM
    Moderator

All replies

  • Hi,

    I'm not an Altiris admin, but it seems to me you need to think through the logic a bit: The service starts the script, which then stops the service. It seems to me that stopping the service would then terminate the script that stopped the service.

    This sounds more like an Altiris support question. Why do you need to restart the service on client machines? If there's a problem with the client service on client machines, it seems to me that you should address it with Altiris support.

    Bill

    • Proposed as answer by jrv Thursday, January 17, 2013 6:33 PM
    • Marked as answer by Bill_StewartModerator Wednesday, February 06, 2013 10:11 PM
    Thursday, January 17, 2013 5:54 PM
    Moderator
  • Bill, I think you are correct. What I'm trying to do is have the machine restart the Altiris service without restarting the computer, to mitigate user disruption. I wasn't sure if there was a quick way to just restart the service and so far I haven't found one. As you mentioned I will see if Altiris support can help me out here. Thanks.

    JR

    Wednesday, February 27, 2013 6:51 PM
  • Hi,

    You can restart a service on a remote computer provided that

    1. You have sufficient access (usually this means being a member of the remote computer's local Administrators group), and

    2. There's not something blocking the network communication between your computer and the remote computer (such as a firewall).

    I'm just pointing out that you probably can't use the Altiris service to restart itself, because once it stops, it can't restart itself (because it's not running).

    Bill

    Wednesday, February 27, 2013 7:01 PM
    Moderator
  • Have the altiris vbscript do two things...

    1. create a windows scheduled task that executes in 1 minute (or whatever delay you wish) which calls a second vbscript that restarts the altiris service.  2. then stop the altiris service.

    Let the  task scheduler restart the service for you.

    Thursday, February 28, 2013 11:53 PM
  • That's even more work. Why not just connect directly to the machine itself, access its services, and restart the broken service directly?

    But there is another question: Why does this need to be done in the first place? If there are problems with a vendor's service, it makes sense to me to engage in troubleshooting that service with the vendor. Restarting the service is a "band-aid" approach to solve some other underlying problem.

    Bill

    Friday, March 01, 2013 3:24 PM
    Moderator