PowerShell script for RMM system to check for last reboot of a windows device and show a windows dialog with reboot options if the last reboot was to long ago
Budget: €30 – €250 EUR
I need a plain Windows Powershell 5.1 script for my rmm system:
1. The RMM starts this script every day at 7 am. This is only informational for you.
2. The script checks for the last reboot of the system. If it was less than 7 days ago, there should be a little info on the console (Write-Host) nothing else to do. Because I can read the console output over the rmm if needed.
3. If the last reboot was more than 7 days ago, the user should see a Windows dialog like this free example on the internet: https://modalyitblog.wordpress.com/2016/10/03/powershell-gui-reboot-prompt/ ... if you can do more fancy gui, go ahead.
4. Three options: Now, Scheduled at 6 pm and Cancel
4.1. Now: write an info to the console (Write-Host), close the dialog and make a reboot right now.
4.2. Scheduled: create a task in the windows taskplanner which reboots the computer once at the offered time (6 pm) today. Write an info to the console, close the dialog and quit the script. Attention: Here we need also a logic for the taskplaner, not that we end up with a huge mess in the windows taskplanner. Maybe a special name for the task. If it exists delete it an create it new... or maybe you have a better idea for that?
4.3. Cancel: Write an information to the console, create a warning-alert in the rmm (don't worry, this is super easy, only two lines of code) and quit the script.
5. The dialog itself should also have a timer of 3 minutes. If no option was choosen by the user within the timer, an info should be written to the console and a reboot should be done.
6. If the last reboot was done more than 10 days ago, I need a critical-alert in the rmm anyways, before the dialog is shown.
7. The script runs automated on a couple of systems, so I need also exception handling with alarming the rmm, otherwise I trust that everything is fine, but the script doesn't do what it should and no one will find out.
8. The dialog needs to be idiot-safe. Show or offer nothing what could give troubles.
9. The dialog needs to be on top of all active windows, otherwise it will not be seen.
---
I need a clean and commented Windows PowerShell 5.1 script. There can't be any extras (e.g. for the gui), because I can only put the code (copy & paste) into the rmm system.
I need a code based on the year 2024 knowledge and also a modern year 2024 dialog design.
---
The SuperOps integration is very simple:
1: Import-Module $SuperOpsModule
2: $res = Send-CreateAlert -Message "$Message" -Description "$Description" -Severity "$Severity"
See:
* https://support.superops.com/en/articles/6632089-do-more-with-scripts
* https://support.superops.com/en/articles/7054997-using-scripts-in-superops
---
Thanks,
Christian.
1. The RMM starts this script every day at 7 am. This is only informational for you.
2. The script checks for the last reboot of the system. If it was less than 7 days ago, there should be a little info on the console (Write-Host) nothing else to do. Because I can read the console output over the rmm if needed.
3. If the last reboot was more than 7 days ago, the user should see a Windows dialog like this free example on the internet: https://modalyitblog.wordpress.com/2016/10/03/powershell-gui-reboot-prompt/ ... if you can do more fancy gui, go ahead.
4. Three options: Now, Scheduled at 6 pm and Cancel
4.1. Now: write an info to the console (Write-Host), close the dialog and make a reboot right now.
4.2. Scheduled: create a task in the windows taskplanner which reboots the computer once at the offered time (6 pm) today. Write an info to the console, close the dialog and quit the script. Attention: Here we need also a logic for the taskplaner, not that we end up with a huge mess in the windows taskplanner. Maybe a special name for the task. If it exists delete it an create it new... or maybe you have a better idea for that?
4.3. Cancel: Write an information to the console, create a warning-alert in the rmm (don't worry, this is super easy, only two lines of code) and quit the script.
5. The dialog itself should also have a timer of 3 minutes. If no option was choosen by the user within the timer, an info should be written to the console and a reboot should be done.
6. If the last reboot was done more than 10 days ago, I need a critical-alert in the rmm anyways, before the dialog is shown.
7. The script runs automated on a couple of systems, so I need also exception handling with alarming the rmm, otherwise I trust that everything is fine, but the script doesn't do what it should and no one will find out.
8. The dialog needs to be idiot-safe. Show or offer nothing what could give troubles.
9. The dialog needs to be on top of all active windows, otherwise it will not be seen.
---
I need a clean and commented Windows PowerShell 5.1 script. There can't be any extras (e.g. for the gui), because I can only put the code (copy & paste) into the rmm system.
I need a code based on the year 2024 knowledge and also a modern year 2024 dialog design.
---
The SuperOps integration is very simple:
1: Import-Module $SuperOpsModule
2: $res = Send-CreateAlert -Message "$Message" -Description "$Description" -Severity "$Severity"
See:
* https://support.superops.com/en/articles/6632089-do-more-with-scripts
* https://support.superops.com/en/articles/7054997-using-scripts-in-superops
---
Thanks,
Christian.