How to check Windows update via device script

Prev Next

This article will show you how to check windows update for certain days via device script.
We will use powershell script as below

$LastUpdate = (Get-Hotfix | Sort InstalledOn -desc)[0].InstalledOn
$LastUpdate -gt (get-date).AddDays(-90)


You can change (-90) to any number you think is suitable for your use case.
Start by uploading the PS script to Device Claim Scripts

Claim Name can be anything you want.
All you need now is to use it in the Policy or Condition.