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.

Workflow to send message to the user if computer has been online for X amount of days/time

Featured Replies

Posted

Is there any way to do this because i can't figure out a simple way to do it and was wondering if anyone else knew or does this or if im just missing something.

  • Administrators

Hey @techNOW

Thanks fro reaching out, you can of course execute this it would just be via a script:

<#
============================================================================================================================================
Script Name:        Audit: Computers: Uptime In Days
Description:        Part of the Extended Audit Content Pack for Servers and Computers delivered by Pulseway.
Usage:              Scheduled to execute in the Task "Extended Audit For Computers - Weekly" tied to the Scope "All Windows 10/11 Computers".
Additional notes:   This script is write protected and is meant to be used "as is" for Extended Auditing purposes.
Vendor:             Pulseway
Lastest version:    2023-01-27
============================================================================================================================================

 

Required variable inputs:
None

 

Required variable outputs:
Name: "OutputUptimeIndays"
Default Type: "Number"
Default Value: "0"
Associated Custom Field: "Audit: System: Uptime In Days"
#>

 

# Please note, this script is write protected and is meant to be used "as is" for Extended Auditing purposes.

 

Function Get-Uptime {
   $OS = Get-WmiObject win32_operatingsystem
   $Uptime = (Get-Date) - ($OS.ConvertToDateTime($OS.LastBootUptime))
   $Display = + $Uptime.Days
   Write-Output $Display
}

 

$OutputUptimeIndays = Get-Uptime
Write-Output "Extended Audit: System: Uptime In Days: $OutputUptimeIndays"

 

# This step writes back the Powershell result to the associated Custom Field.
Start-Process -FilePath "$env:RMM_HOME\CLI.exe" -ArgumentList ("setVariable OutputUptimeIndays ""$OutputUptimeIndays""") -Wait

 

You can use just the the Output variable, no Custom Field is required for this to work. Then make a condition based on the output variable being higher than X days in a Workflow. You will need to run it as a script for it to become a Number type variable as currently the Workflow Action "Execute PowerShell Command" only produce Text type variables. So that won't work for the condition.

 

I hope this helps and if you need any more assistance lease let me know

Thanks, 
Stefan 

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.