Jump to content
TechnicalHero

Calling a script on different Agents

Recommended Posts

Afternoon MSPGeeks,

I have a system that is split accross 4 Virtual Servers. Each VM has about 4 services that are required for my app to run. Once in a while I need to restart it, but I dont want to restart the VMs, the services have to be started in a partiuclar order. If I create a script to do that for Server1, is it possible to call another script which will do the same thing but on server2, then server3 etc.

Or, should I really be looking at running the script on Server1 which runs a bunch of powershell scripts remotely on server2, server3 then server4?

Kind regards,

Share this post


Link to post
Share on other sites

Ideally you'll have a log you can monitor for when the services aren't behaving properly then you can call your script as the auto fix. The monitor will run on each vm and execute the correct restart sequence on each vm that fails. 

 

Alternatively you can set @computerid@ variable to the computer you want to run the commands on inside the script so you can loop through each VM computerid and then call your set of commands each time. The documentation on the university has this as an example if you look for script docs using sqldataset it'll teach you about looping and changing computers. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...