---
title: "Run PowerShell Scripts in Pulseway: A Step-by-Step Tutorial"
description: "Explore a step-by-step tutorial on running PowerShell scripts in Pulseway and get some great ideas for your IT operations."
canonical: "https://adamtheautomator.com/pulseway/"
---

# Run PowerShell Scripts in Pulseway: A Step-by-Step Tutorial

> Explore a step-by-step tutorial on running PowerShell scripts in Pulseway and get some great ideas for your IT operations.

Source: https://adamtheautomator.com/pulseway/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Run PowerShell Scripts in Pulseway: A Step-by-Step Tutorial](https://adamtheautomator.com/wp-content/uploads/2019/06/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway-pulseway.jpg)

# Run PowerShell Scripts in Pulseway: A Step-by-Step Tutorial

[![](https://secure.gravatar.com/avatar/d0b9d42e21e5622713f8b693aa5c0f9244d5f7dd200ed29b8398f52dee5de337?s=192&d=mm&r=g)Adam Bertram](https://adamtheautomator.com/author/adam-bertram/)14 June 20195 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[PowerShell](/tag/powershell/)[Product Review](/tag/product-review/)[Pulseway](/tag/pulseway/)[Sponsored](/tag/sponsored/)

> _This blog post has been sponsored by Pulseway._

So you’ve got an awesome PowerShell script that is going to save you loads of time. You’ve hit _Save_ in your editor and you pat yourself on the back. This script is meant to run against multiple servers so you sit down to make it happen to then find out it’s not as easy as you’d anticipated.

Running PowerShell scripts against remote systems can lead to problems around targeting systems, dealing with remote connectivity issues, and increasing performance by running them in parallel. Luckily, I’ve been working with a tool lately called [Pulseway](https://www.pulseway.com/rmm-software?rfid=eo_ab_mvp) that eases this issue.

In this Pulseway review, I’m going to show you how to execute your PowerShell scripts against a group of remote systems using the Pulseway product.

We’ve got a couple of persistent issues in the TechSnips server environment at the moment. The first is that we need to restart the print spooler service on all of our servers every night. And secondly, our contributors keep leaving their PowerShell ISE sessions open 24/7. I’ve already written some scripts to deal with these issues, and I’m going to use Pulseway to automatically run them against multiple systems.

So within Pulseway, head over to Automation, and then start in _Scripts_.

![Script menu item in Pulseway](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps1.png)

Script menu item in Pulseway

By default, you’ll have a built-in category here, and you’ll want to create your own category to file your scripts into.

![Script category in Pulseway](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps2.png)

Script category in Pulseway

I’ll create my own category and call it _Custom_. Once the category is created, we can click into that category and choose _Create Script_. Give your script a name. My first one will be _Restart Print Spooler Service_.

![Creating new script in Pulseway](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps3.png)

Creating new script in Pulseway

Then I’ll head over to the _Windows_ tab, toggle to _Enabled_, and then I can select my script type. This defaults to PowerShell, which is what I want to use. However, if you need a VBScript or batch file, you switch the script type.

I’ll leave that on PowerShell and enter my script. The script I’m using here is stopping the service, waiting for a couple of seconds, and then starting the service back up again.

When I’m happy with everything here, I’ll click _Save Script_

```powershell
Start-Sleep -Seconds 5
Stop-Service -Name 'spooler'
Start-Sleep -Seconds 3
Start-Service -Name 'spooler'
```

With that saved, I’ll head back to _Scripts_, and I’m going to add my second script to cover my second issue. This one is going to kill PowerShell ISE sessions. However, there’s a caveat on this, where I don’t want to kill any PowerShell ISE processes that are owned by admin users; I’ll make a note of that in the description.

Again, I’ll head over to the _Windows_ tab, ensure I’m on PowerShell and add my script.

```powershell
Start-Sleep -Seconds 5
$PsProcs = Get-CimInstance Win32_Process -Filter "name = 'powershell_ise.exe'"

foreach ($Proc in $PsProcs) {
	$Owner = Invoke-CimMethod -InputObject $Proc -MethodName GetOwner
    if ($Owner.User -notlike 'admin*') {
    	Stop-Process -Id $Proc.ProcessId -Force
    }
}
```

This script’s going to get all the PowerShell ISE processes, look through them, checking for the owner using the `GetOwner` method, and then if the owner doesn’t start with the word “admin,” it’s going to stop that process. I’ll click _Save Script_ to confirm.

With both of my scripts created, we now need to combine them into a task. So under _Automation_, choose _Tasks_ and _Create Task_.

![Creating. a Pulseway task](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps4.png)

Creating. a Pulseway task

There are some extra options we can pick here before going ahead and adding our actual scripts. For instance, I do want to be kept informed about whether or not this task is running successfully, so I’ll turn on notification for if the task fails. And I’ll leave that as elevated, although you can adjust the level as needed.

And I also want to get a notification if the task completes successfully. However, I’m not going to leave this at normal, because I don’t want my phone to make noise when this works successfully, and I have my low notifications silent, so I’ll just set it to low.

![Pulseway notifications](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps5.png)

Pulseway notifications

The default scope is _All Systems_, and if you’ve already got another scope created, you can select it here to limit the systems that this will run on. And if you haven’t already got a scope, but you’d like to create one now, there’s a handy button, _Create Scope_, where you can get one set up now.

I’m all right with my task targeting all systems, so I’m not going to create a scope here.

![Setting script scope in Pulseway](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps6.png)

Setting script scope in Pulseway

But I do want to enable scheduling, as I want this to happen every night. I’ll change the _Repeats_ option to _Daily_, and it will happen every once a day. I want this running at about 1:00 AM, so I’ll change the date to tomorrow, and I’ll change the time to 1:00 AM.

In the _Summary_, I can confirm that my schedule is what I want, daily, starting tomorrow at 1:00 AM.

![Setting a schedule in Pulseway](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps7.png)

Setting a schedule in Pulseway

Once I’m happy with this, I’ll click _Save_ and scroll back up to the top and choose _Scripts_.

![Setting a script to run in a task](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps8.png)

Setting a script to run in a task

From here, choose your category; mine was called _Custom_. I’ll add both of the scripts that we’ve defined at the start. I’ll start with my print spooler service and then my ISE processes termination script.

Now, these do run sequentially, so if the order is important, make sure you’ve put them in the right order. And when you’re happy with it, save the task.

![Creating. a script task](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps9.png)

Creating. a script task

So let’s head back to _Tasks_, and you can see the little alarm clock icon within the cog showing you that this is a scheduled job. However, we can run this on demand so we can see a little bit closer at what’s happening. I’ll go into _View_…

![Viewing the script task](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps10.png)

Viewing the script task

…and then click _Start_. We can see the status of it as it runs. So we can see it’s targeting four systems, and it’s currently completed zero of them, and the status of the job is running.

![Inspecting the job details](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps11.png)

Inspecting the job details

If I pull up my ISE, I’m currently checking my print spooler service, and you can see that it was automatically stopped and then restarted.

![Pulseway script task output](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps12.png)

Pulseway script task output

So we know that this job has successfully run against my machine. If we check the execution history, we can see that the entire job was successful, meaning it successfully ran on the other three servers in the TechSnips server environment. I can drill into this and have a look at the systems, and I can see that each individual system successfully completed.

And if there were any failures, I could drill in deeper and have a look at the output for each individual job. As these were all successful, I expect the output to be blank, but if there were any errors, you would see them listed here.

![Job details](https://adamtheautomator.com/content/images/2019/07/how-to-execute-custom-powershell-scripts-against-a-group-of-systems-with-pulseway---ps13.png)

Job details

This was a great example of how we can leverage Pulseway to help out with distributing PowerShell scripts.

If you’d like to learn more about Pulseway and give it a spin, it is available at [pulseway.com](https://www.pulseway.com/rmm-software?rfid=eo_ab_mvp).

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fpulseway%2F&text=Run%20PowerShell%20Scripts%20in%20Pulseway%3A%20A%20Step-by-Step%20Tutorial)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fpulseway%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fpulseway%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2021/11/Upping-the-Automation-Ante-with-PowerShell-Universal.jpg)

### [Upping the Automation Ante with PowerShell Universal](/powershell-universal/)

Learn how to up the ante with PowerShell Universal by IronMan Software via the latest Product Review by ATA and Friends!

![](https://adamtheautomator.com/wp-content/uploads/2023/04/enzoicfeaturedimage.jpg)

### [Enzoic for Active Directory: Enhanced Password Security](/enzoic-for-active-directory/)

In this ATA Learning product review, learn if and how Enzoic for Active Directory protects monitored entities from compromised passwords!

![](https://adamtheautomator.com/wp-content/uploads/2022/09/uberAgentGraphicCompressed.jpg)

### [uberAgent: In-Depth User Experience & Security Analytics](/uberagent/)

In this ATA Learning product review, discover if uberAgent lives up to it’s promise of in-depth user experience and security analytics tracking!

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
