The main objective of this article is to provide step-by-step instructions on how to use PowerShell script to set and modify the Windows update policy using a Windows bundle. The Windows 10 update settings can be easily re-configured using this bundle.
This document includes the following information:
Prerequisites
Creating the Bundle
Deploying the Bundle
Logging Results
Prerequisites
Prior to deploying the bundle, you need be aware of the following:
The Windows bundle can be deployed only on Windows 10 devices.
Using the bundle, you can modify the update settings for Windows 10 devices. However, if the same setting is controlled by a group policy, the latter will prevail.
Prior to deploying the bundle, you must enable script execution by running the following command: Set-ExecutionPolicy <Unrestricted / AllSigned/ RemoteSigned>).
By default, the value set as Restricted.
Creating the Bundle
To create the Windows bundle:
In ZENworks Control Center, create a Windows bundle and add the modifyWindowsUpdateConfiguration.ps1, the settings.xml and the Setupconfig.ini files. For the Setupconfig.ini file, ensure that you specify the Destination Directory as %systemdrive%\Users\Default\AppData\Local\Microsoft\Windows\WSUS\
In the Bundles page, click the bundle that was created in the previous step and click Actions > Launch.
Click the Run Script Action link and in the Edit Action – Script dialog, specify the Action Name, Script File Name, Script Parameters and Path to Script Engine.
Click the Advanced tab and select the Run as secure system user (Don’t allow system to interact with desktop)
After specifying the relevant values, click OK and then Publish the bundle.
Note: While creating the bundle, ensure that the path for the install files is correct and it is the same as that specified in the run script.
Deploying the Bundle
To deploy the bundle, assign the bundle to the specific users or devices and specify the deployment schedule. After the bundle is deployed, the required settings will be modified based on the settings.xml file.
Results of the script execution can be viewed in the %ZENworks_home%/logs/windowsUpdateConfigurationLog file. In this file you can view the settings that have been successfully set and those which could not be set due to errors.
The log file will also include the updated policy settings.
The relevant script code and required files are present in the below pdf: