Jump to content
View in the app

A better way to browse. Learn more.

Pulseway

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Posted

Wrote this script with the help of Support. Thanks Ermins!

$days = 35
$system = Get-WmiObject win32_operatingsystem

if($system.ConvertToDateTime($system.LastBootUpTime) -lt (Get-Date).AddDays(-$days)){
    Restart-Computer -Force
}else{
    Write-Host "Machine was rebooted less than $days days ago"

}

Featured Replies

  • Author

Say I run this against 90 computers is there any way to get a notification of which computers rebooted?

  • Administrators

All machines that reboot will timeout the script execution. So when you look at the task execution you will see it running for an hour if you don't stop it. The machines that reboot will show up as failed in the task execution results view.

-Paul

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.