Summary
This article outlines how to deploy custom PowerShell scripts via Microsoft Intune to detect and remediate issues with the ActivTrak Agent. Specifically, these scripts help verify if the ActivTrak Agent is installed and ensure that the SVCTCOM service is running and set to start automatically.
Use Case
Organizations using Microsoft Intune for device management may want to automatically detect if ActivTrak is installed and ensure the monitoring service remains active. These scripts support proactive monitoring and self-healing of the ActivTrak Agent on Windows devices, even if an end user stops the service.
Prerequisites
Before deploying these scripts, ensure the following:
- A valid Microsoft Intune subscription.
- Admin access to the Intune portal.
- Target devices must be Windows machines where ActivTrak is expected to be installed.
- Devices must support the execution of PowerShell scripts via Intune.
Script Functions
Detection Script: ATDetection.ps1
This script checks:
- Whether the ActivTrak Agent is installed by locating its default installation path.
- Whether the SVCTCOM service (ActivTrak’s background service) exists and is running.
If the service is missing or not in a "Running" state, the script flags the device as non-compliant.
Remediation Script: ATRemediation.ps1
If the detection script finds an issue, this script:
- Attempts to start the SVCTCOM service.
- Changes the service's Startup Type to Automatic to ensure it runs on boot.
Deployment Steps
1. Add Scripts to Intune
- Sign in to the Microsoft Intune admin center.
- Go to Devices > Scripts > Add > Windows 10 and later.
- Upload
ATDetection.ps1andATRemediation.ps1as two separate scripts. - Provide a name and description for each script (e.g., ActivTrak Detection Script, ActivTrak Remediation Script).
- Configure the following script settings:
- Run this script using the logged on credentials: No
- Enforce script signature check: No
- Run script in 64-bit PowerShell: Yes
- Assign the scripts to the appropriate device group(s).
- Click Add to finalize.
2. Monitor Execution Results
- After deployment, view script results in the Intune portal under the Device status tab.
- Devices where the detection script flags an issue will automatically trigger the remediation script.
- Verify that the remediation script starts the SVCTCOM service and sets it to Automatic.
Best Practices
- Test scripts in a staging environment before broad deployment.
- Regularly audit service health using Intune reporting.
- Keep PowerShell scripts versioned and documented internally for change tracking.
Troubleshooting
| Issue | Suggested Action |
|---|---|
| Scripts fail to execute | Ensure the target device meets PowerShell execution policy and permissions. |
| SVCTCOM service not found | Confirm that the ActivTrak Agent is installed properly on the device. |
| Remediation fails | Check script logs in Intune for specific error messages. |