Do more with scripts!
Manish Balaji avatar
Written by Manish Balaji
Updated over a week ago

Use the sample scripts below to automate tasks and make the best use of scripts in SuperOps.ai.

When you're managing a large number of client endpoints, scripts are a lifesaver. When you make the best use of scripts in your MSP, you cut out the massive grunt work of manually managing these devices individually and make sure that your network devices are up to date and working smoothly.

Scripts are amazing and we should be using them as much as we can to make life easier. With that in mind, we wanted to share some very useful scripts to get you started with script management in SuperOps.ai.

But first, we'll be looking at what a module is and its functionality, followed by scripts you can use along with their functionality. Let's jump right in.

What is a module?

A module is a package that contains PowerShell members, such as cmdlets, providers, functions, workflows, variables, and aliases.

These modules can be organized and shared to work in conjunction with other PowerShell scripts as a built-in function. These modules when combined with scripts can help technicians automate and perform a variety of complex tasks with ease.

Now that we've covered what a module is, let's move on to importing modules into the platform, along with some sample scripts for you to start using.

Importing the SuperOps.ai Module

To make sure that the script is properly imported into the platform, the following line needs to be in the first line of the script.

Import-Module $SuperOpsModule

Functions of the SuperOps.ai Module

1) Adding a file in SuperOps.ai

Send-File -FileName <Exact location of the file>

Example: Send-File -FileName "c:/working/test.png"

2) Populating a custom field with a value fetched from the asset

Send-CustomField -CustomFieldName <CustomFieldNamein RMM Monitoring class> -Value <Value to be sent>

Example:

Send-CustomField -CustomFieldName "CustomNumber1" -Value "TestData"

πŸ“ Note: This works only for text, long text, decimal, and number data type fields. Click here to know more about adding asset custom fields.

3) Sending alerts to the logged in-user in the system

Send-UserAlert -Message <Message to be displayed>

Example:

Send-UserAlert -Message "Machine is going to shut down. Please save your work."

πŸ“ Note:

This function works only when there is a user logged into the device.

4) Capture a screenshot of the logged-in user

Get-UsersScreenShot -DestinationPath <full path of destinationLocation>

Example:

Get-UsersScreenShot -DestinationPath "C:\working\test.png"

πŸ“ Note:

This function works only when there is a user logged into the device.

Did this answer your question?