Zerkana

jueves, 19 de julio de 2018

Automate Windows 10 Updates with Batch Script and GPOS



Hi everyone,


In this entry, we will make a batch file to automate Windows 10 updates to new build 1803. As you know, Windows 10 version updates could block user's computer for about 45min, this batch script could automate all the process and be scheduled to run off hours.

So, let's do it.



1. Download Windows 1803 ISO, you can use Microsoft Media Creation tool: https://www.microsoft.com/es-es/software-download/windows10ISO



2. Unpack ISO and place on a Shared folder, you can make it hidden by using "$" key. Be sure to grant privileges to users or groups that will access.

 



3. Create a Batch file "Download.bat" to download content to the user's computer.

This Batch file will create an Upgrade folder on C:, 6 Gb free needed, execute the upgrade on next startup.
{
mkdir C:\upgrade
start /wait Robocopy \\srvvm1\upgrade$ C:\upgrade /mir
Reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v WIN10 /t REG_SZ /d C:\upgrade\installWIN.bat /f
start /wait MsiExec.exe /X {8097EE64-FDE1-409A-B25D-3DFD862871E1} /passive
}
4. Create a Batch file "InstallWIN.bat" to install the update.
{
C:\upgrade\setup.exe /auto upgrade
}
5. Now automate process

  5.1 We can make a GPO, and apply to computers from a security group or inherit by OU.








  5.2 We can use remote execution with powershell.





  5.3 Add as scheduled task on clients

Finally, just reboot or, if you prefer, you can run directly installWIN.bat and done.




Enjoy :)

No hay comentarios: