Office Activation Status
Summary
Generates an alert for any unlicensed Office products on the endpoint.
Monitor
-
Navigate to
Endpoints>Alerts>Monitors

-
Click the
Create Monitorbutton.
-
This screen will appear.

-
Name: Office Activation Status
Description: Generates an alert for any unlicensed Office products on the endpoint
Type: Script
Family: Desktop Operating System
Severity: Others

-
The
Conditionstab will start looking like this:

-
Set the
Repeat everyto24Hours:
-
Disable the
Ticket Resolutionsection by clicking theAutomatically resolvebutton.

-
Paste this PowerShell script in the
Scriptbox.$ErrorActionPreference = 'SilentlyContinue'
#region Setup - Variables
$ProjectName = 'Get-OfficeActivationStatus'
[Net.ServicePointManager]::SecurityProtocol = [enum]::ToObject([Net.SecurityProtocolType], 3072)
$BaseURL = 'https://file.provaltech.com/repo'
$PS1URL = "$BaseURL/script/$ProjectName.ps1"
$WorkingDirectory = "C:\ProgramData\_automation\script\$ProjectName"
$PS1Path = "$WorkingDirectory\$ProjectName.ps1"
$Workingpath = $WorkingDirectory
$LogPath = "$WorkingDirectory\$ProjectName-log.txt"
$ErrorLogPath = "$WorkingDirectory\$ProjectName-Error.txt"
#endregion
#region Setup - Folder Structure
New-Item -Path $WorkingDirectory -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
$response = Invoke-WebRequest -Uri $PS1URL -UseBasicParsing
if (($response.StatusCode -ne 200) -and (!(Test-Path -Path $PS1Path))) {
throw "No pre-downloaded script exists and the script '$PS1URL' failed to download. Exiting."
} elseif ($response.StatusCode -eq 200) {
Remove-Item -Path $PS1Path -ErrorAction SilentlyContinue
[System.IO.File]::WriteAllLines($PS1Path, $response.Content)
}
if (!(Test-Path -Path $PS1Path)) {
throw 'An error occurred and the script was unable to be downloaded. Exiting.'
}
#endregion
#region Execution
$licenseInfo = & $PS1Path
return $licenseInfo.LicenseStatus
-
Set
Unlicensed,Non_Genuine_Grace_Period, andOut_Of_Tolerance_Grace_Periodto theScript Outputbox.
-
Enable the
Escalate ticket on script failureoption.
-
Select the required client or group to target from the
Select Targetsbutton.
-

-
Click the
Savebutton to save the monitor set.