Files
Intune/intune/Proactive Remediations/System Update Check-Notifications/Detect_Uptime.ps1
2025-05-14 13:25:48 -04:00

8 lines
299 B
PowerShell

$Uptime= get-computerinfo | Select-Object OSUptime
if ($Uptime.OsUptime.Days -ge 7){
Write-Output "Device has not rebooted on $($Uptime.OsUptime.Days) days, notify user to reboot"
Exit 1
}else {
Write-Output "Device has rebooted $($Uptime.OsUptime.Days) days ago, all good"
Exit 0
}