• Run regedit to open Registry Editor.
• Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU.
• If the keys don’t exist, create them.
• Create a new DWORD (32-bit) Value named NoAutoRebootWithLoggedOnUsers and set its value to 1.
(https://learn.microsoft.com/en-us/windows/deployment/update/waas-restart)