Читать книгу Windows Server 2022 & Powershell All-in-One For Dummies - Sara Perrott - Страница 92
SETTING UPDATES TO AUTOMATIC VIA PowerShell
ОглавлениеTo set updates to automatic via PowerShell, you need to navigate to C:\Windows\system32
and stop the Windows Update service. It may already be stopped. Then you can use the script program to execute scregedit.wsf. Adding the switch /AU 4 enables automatic updates, /AU 1 would disable automatic updates. The following example enables Windows updates:
1 Stop the Windows Update Server service. net stop wuauserv
2 Set automatic updates to 4 which is enabled. cscript scregedit.wsf /AU 4
3 Start the Windows Updates Server service. net start wuauserv
If you would like to see an example of what this looks like and what the responses should be, please see Figure 4-7.
FIGURE 4-7: Setting automatic updates in PowerShell.