You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a toast that has a reboot button and a snooze button based upon selection of 5 mins, 10 mins....up to a day.
the reboot calls a ps1 from registry that sends an email saying user clicked reboot, thus giving me notification of event. and then the ps1 reboots the system. However the snooze does not send an email while still keeping the selection options. here is what i have thus far...please advise if you have any solutions. thanx
is there an arguments (for the email) options for the snooze button while also keeping the selectionsbox options.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have created a toast that has a reboot button and a snooze button based upon selection of 5 mins, 10 mins....up to a day.
the reboot calls a ps1 from registry that sends an email saying user clicked reboot, thus giving me notification of event. and then the ps1 reboots the system. However the snooze does not send an email while still keeping the selection options. here is what i have thus far...please advise if you have any solutions. thanx
is there an arguments (for the email) options for the snooze button while also keeping the selectionsbox options.
`
New-Item -Path "C:" -Name "dploy" -ItemType "directory"
New-Item -ItemType "directory" -Path "C:\dploy\DoNotDelete\Toast_Reboot"
Copy-Item -Path "\Server1\DoNotDelete\Toast_Reboot\SendRebootMail.ps1" -Destination "C:\dploy\DoNotDelete\Toast_Reboot"
Copy-Item -Path "\Server1\DoNotDelete\Toast_Reboot\ToastRebootCmd.bat" -Destination "C:\dploy\DoNotDelete\Toast_Reboot"
Copy-Item -Path "\Server1\DoNotDelete\Toast_Reboot\Logo.jpg" -Destination "C:\dploy\DoNotDelete\Toast_Reboot"
*****************************************************************************************************
Create Registry Location for EventLogs...
New-item -Path "HKLM:\SYSTEM\ControlSet001\Services\EventLog" -Name "BurntToast" -force
$newValue = New-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Services\EventLog\BurntToast" -Name 'BurntToast' -PropertyType MultiString -Value @"
abcApplication
cdeApp
"@
$newValue.multistring
*****************************************************************************************************
#Checking if ToastReboot:// protocol handler is present
Deletes the key if it already existed, to make sure any changes made take effect...
reg delete HKEY_CLASSES_ROOT\ToastReboot /f
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT -erroraction silentlycontinue | out-null
$ProtocolHandler = get-item 'HKCR:\ToastReboot' -erroraction 'silentlycontinue'
if (!$ProtocolHandler) {
#create handler for reboot
New-item 'HKCR:\ToastReboot' -force
set-itemproperty 'HKCR:\ToastReboot' -name '(DEFAULT)' -value 'url:ToastReboot' -force
set-itemproperty 'HKCR:\ToastReboot' -name 'URL Protocol' -value '' -force
new-itemproperty -path 'HKCR:\ToastReboot' -propertytype dword -name 'EditFlags' -value 2162688
New-item 'HKCR:\ToastReboot\Shell\Open\command' -force
# The CMD file below is used to execute a ps1 file in the same directory that sends an email and then starts a Reboot...
set-itemproperty 'HKCR:\ToastReboot\Shell\Open\command' -name '(DEFAULT)' -value 'C:\dploy\DoNotDelete\Toast_Reboot\ToastRebootCmd.bat /q' -force
}
#******************************************************************************************************
Install-Module -Name BurntToast -Confirm:$false -Force
Install-module -Name RunAsUser -Confirm:$false -Force
invoke-ascurrentuser -scriptblock {
}
`
Beta Was this translation helpful? Give feedback.
All reactions