PowerShell script to start a scan from a device
Have you ever needed to run a scan from the client side?
There are times when you may want to trigger a scan from the device as part of an automation rather than from the console (or waiting for the next scheduled scan to run). One example is to automatically update the Automox inventory when a Windows 10 in-place upgrade successfully completes.
Luckily, @Nic recently published a topic to clean up inactive devices (Powershell script to remove devices that have been disconnected longer than X days) that I was able to repurpose to manage this task. Thank you @Nic!
This script leverages the API to identify the local device, and then sends a secondary API call to schedule a scan for itself (Pretty handy, right?).
There are two areas in the code you’ll need to update to get the script to function:
$orgID = ‘YOUR_ORG_ID’ - put your Org ID, which can be found by looking at the URL of your console and selecting the value after the “?o=”: https://console.automox.com/dashboard?o=999999 1. In