last reboot

Occasional Contributor

Is there a way to pull a report of all devices' last reboot in Intune?

5 Replies
I guess pro active remediations would be possible

$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

Something like @Rudy_Ooms_MVP is suggesting can probably also be done with Custom Compliance (linking to Peter van der Woude's blog, because he explains it better :smile:) which are basically Pro-active Remediations without the remediation, with compliance-flavor sprinkled over it.


All in all, there's no metadata about uptime recorded in Azure AD and/or Intune, so there's no way to report on it without extra config.

:p and what about me explaining the custom compliance policies and how to create them and troubleshoot them :p

Points deducted! :smile: My apologies, @Rudy_Ooms_MVP. I missed that one btw, so reading it now. 

I added the script below:
Get-CimInstance -ClassName win32_operatingsystem | select csname, lastbootuptime


how to grab the output?