Scripts Reference
This document describes each of the custom functions available for PowerShell and Mac Bash.
Notes:
- For more details and examples, see the PowerShell or Mac Quick Help at the bottom of any new/edit script page in Syncro.
- Be sure to include Import-Module $env:SyncroModule as the first line in your script.
Although the syntax differs slightly, Syncro provides the following custom functions for both PowerShell and Mac Bash:
- RMM Alert: Creates an alert in Syncro and triggers the "New RMM Alert" in the Notification Center, automatically de-duping per asset. For example, a script to check whether hard drive space is below a certain percent can trigger an RMM Alert in Syncro, which ties into the dashboard and triggers a notification. This can be also hooked into anything you can script in PowerShell (e.g., the Event viewer, WMI, etc.). See also Customize & Assign Notifications.
- Display Alert: Pops up a message for the currently logged in user. This must be used with a script running as “current user.”
- Log Activity: Adds a row to the "Recent Activity" section on the Asset's Details Page.
- Get Screen Capture: Saves a screenshot to the filename you specify, which is great to use with Required Files.
- Send Email: PowerShell has SMTP Email already, but you have to add an SMPT server. Our Send-Email function uses our API and doesn't need anything except Internet access.
- Upload File: Uploads a file to Syncro and attaches it to the Asset.
- Set Asset Field: Writes to your Asset Custom Fields. Use it to store ad-hoc information that isn't currently surfaced.
- Create Syncro Ticket: Creates a Ticket attached to the Asset the End User associated with it.
- Create Syncro Ticket Comment: Adds a Ticket Comment/Communication to a ticket. This can be public/private, email or not, etc. See also About the Ticket Communications Section.
- Create Syncro Ticket Timer Entry: Adds a timer entry to a ticket. See also Add Billable Time to a Ticket.
- Update Syncro Ticket: Updates a ticket; currently this only supports Status and custom fields. See also Create Custom Fields for Assets & Tickets.
- Close RMM Alert: Closes an RMM alert in Syncro. Since there can only be one of each alert category per asset, it will find the correct one. If no alert exists it will exit gracefully. You can also choose to close a Ticket generated from the alert.
- Broadcast Message: Sends a broadcast message to the asset and optionally adds a row to the "Recent Activity" section on the Asset's Details Page.