Leveraging PowerShell scripts in N‑central Automation Manager

I’m sure for most of you reading this, you are well aware of just how powerful PowerShell can be. Speaking with partners and prospects over the years who were either using or evaluating our software, I’d often get asked: “Can your products do X?”. More often than not the answer would be “Yes”, but every so often, I’d have to say “No, but if you can do it through PowerShell, we should be able to leverage Automation Manager to run it in N‑central.”
In this blog I’m going to look at some of the benefits of running your PowerShell scripts via Automation Manager in N‑central, and give you some ideas of how you can leverage this.
The key benefits of leveraging PowerShell scripts via Automation Manager
Right at the top of the list of benefits of leveraging PowerShell scripts via Automation Manager has to be the ability to enhance the monitoring capabilities of N‑central beyond what’s available out of the box. With PowerShell you can often pull the exact information you are looking for at any one time. But how do you pull that information regularly and/or get alerts when anything changes? This is where Automation Manager comes into play.
You can use the Run PowerShell Script cmdlet in Automation Manager to execute your PowerShell script. This cmdlet also supports Output Parameters, which can define the output from your automation policy. Any automation policy you create that provides output can be used for monitoring purposes in N‑central. So, for example, if you need to monitor a certain backup application and you have the PowerShell script to do this, leveraging Automation Manager will allow you to define what information you want to output from this script. Once you import this into N‑central, you can define thresholds for alerting based on the output that’s being provided.
Defining Input Parameters
Using Automation Manager to output information from PowerShell scripts is a powerful tool for monitoring purposes, but did you know you can also use Automation Manager to define Input Parameters into your PowerShell scripts? Thus making them more flexible. For example, you might have a PowerShell script that finds all Hyper-V checkpoints that are older than ‘7’ days. However, with Automation Manager you can replace that ‘7’ with an Input Parameter so that you can define the period of time you are looking for, as the requirement may change from server to server and customer to customer.
Using predefined cmdlets
Since Automation Manager is built on top of PowerShell and contains 600+ predefined cmdlets, you can also use these predefined cmdlets to enhance your PowerShell scripts. Say you run a PowerShell command to get the expiry date of a certificate on a device, however, for monitoring purposes you don’t want to know the date of expiration. Instead you want to how many days are left before it expires. In this case, rather than outputting the date directly from the script, you can feed that information into the prebuilt Date Difference cmdlet. This calculates the difference between the date of expiry on the certificate and the current date, and then outputs the number of days left before the script expires rather than the expiry date itself. You can then set your thresholds in N‑central to be notified if a script is due to expire in X number of days.
These are just a few examples of how you can use PowerShell scripts via Automation Manager to enhance how you use N‑central to manage and maintain your customers. Be sure to check out our PowerShell Automation Cookbook, where you might find some PowerShell scripts you can enhance by leveraging them in Automation Manger.
If you have questions join me on the N-Central Office Hours, alternatively keep an eye on www.n-able.com/events to register for the live sessions. For deeper insight you can also check out the following on-demand N‑able Boot Camps:
- Introduction to PowerShell Boot Camp
- N‑central General Automation Boot Camp, Part 1
- N‑central General Automation Boot Camp, Part 2
- NC Advanced Automation Boot Camp
Paul Kelly is the Head Nerd at N‑able. You can follow him on Twitter at @HeadNerdPaul, LinkedIn and Reddit at u/Paul _Kelly
© N‑able Solutions ULC and N‑able Technologies Ltd. All rights reserved.
This document is provided for informational purposes only and should not be relied upon as legal advice. N‑able makes no warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information contained herein.
The N-ABLE, N-CENTRAL, and other N‑able trademarks and logos are the exclusive property of N‑able Solutions ULC and N‑able Technologies Ltd. and may be common law marks, are registered, or are pending registration with the U.S. Patent and Trademark Office and with other countries. All other trademarks mentioned herein are used for identification purposes only and are trademarks (and may be registered trademarks) of their respective companies.