jantari / LSUClient

Orchestrate driver, BIOS/UEFI and firmware updates for Lenovo computers 👨‍💻
https://jantari.github.io/LSUClient-docs/
MIT License
208 stars 22 forks source link

BIOS - Prompt user to reboot? #69

Closed mtengmo closed 1 year ago

mtengmo commented 1 year ago

Version

1

Question

Is it possible to send user a prompt to reboot? A toast notification? Or is it usually done in a task sequence ?

Thanks, Magnus

animentork commented 1 year ago

A registry value is created indicating if a reboot or shutdown is necessary:

HKEY_LOCAL_MACHINE\SOFTWARE\LSUClient\BIOSUpdate ActionNeeded REG_SZ REBOOT or SHUTDOWN

You can then read this value in the next step of your task sequence and act on it however you like. For toast notifications, here is a pretty good example how to do that with PowerShell: https://den.dev/blog/powershell-windows-notification/

Note: Scripts in SYSTEM user context might need to use Microsoft's ServiceUI.exe tool that comes with MDT. Without it, you can't let SYSTEM display a message to the user, because SYSTEM runs in non-interactive mode and doesn't have access to the session. SYSTEM can, however, call ServiceUI.exe, which starts another process in interactive mode - that process would be PowerShell.exe executing the toast notification PowerShell script.

jantari commented 1 year ago

Hi, yes you can send toast notifications with PowerShell - some examples:

  1. https://den.dev/blog/powershell-windows-notification/ (the link @animentork shared)
  2. https://www.imab.dk/windows-10-toast-notification-script/ which looks pretty fancy
  3. There's also the BurntToast module https://github.com/Windos/BurntToast which makes it easier

Regarding when to send the notification asking for a reboot, you should follow the advice in the documentation: https://jantari.github.io/LSUClient-docs/docs/topics/bios-and-firmware/#handling-reboots

Going by the PendingAction property of an installed update is preferred and recommended over using the ActionNeeded registry key and the -SaveBIOSUpdateInfoToRegistry switch for the reasons explained in the docs site.

Does this answer your question?

jantari commented 1 year ago

Closing due to no response.

It's possible to send prompts and notifications, but it's out of scope for LSUClient. You can add/script them yourself.