Intune script that will check the uptime of each machine in the organization and restart laptop after checks

Christos Christopoulos 35 Reputation points
2024-10-23T10:24:26.2633333+00:00

Hello everyone,

I need your help, please, because I’m feeling desperate. I want to create a detection and a remediation script in Intune. As a result, I would like it to check if the uptime of each machine reaches 5 days and send a warning to the user: “Your PC has been on for 5 days, please restart.” On the 6th day, the warning will say: “Save your work because in 10 minutes your PC will restart,” and then the PC will automatically restart (force restart).

Τhank you

Windows for business Windows Server User experience PowerShell
Microsoft Security Intune Other
{count} votes

1 answer

Sort by: Most helpful
  1. Pavel yannara Mirochnitchenko 13,331 Reputation points MVP
    2024-10-30T11:12:29.3733333+00:00

    If you specificly want to restart computers each 6 days, I would seach and investigate how to do a Task with Task Scheduler using powershell and how to add the message system to it.

    Another consideration is, may I ask why you want to do this? Could the reason be a Fast Start up still turned on by default. Just thinking, are you aware of this?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.