Configuring devices through the Windows Update for Business reports configuration script

The Windows Update for Business reports configuration script is the recommended method of configuring devices to send data to Microsoft for use with Windows Update for Business reports. The script configures the registry keys backing policies, ensures required services are running, and more. This script is a recommended complement to configuring the required policies documented in Manually configure devices for Windows Update for Business reports, as it can provide feedback on whether there are any configuration issues outside of policies being configured.

About the script

The configuration script configures registry keys directly. Be aware that registry keys can potentially be overwritten by policy settings like Group Policy or MDM. Reconfiguring devices with the script doesn't reconfigure previously set policies, both in the case of Group Policy and MDM. If there are conflicts between your Group Policy or MDM configurations and the required configurations listed in Manually configuring devices for Windows Update for Business reports, device data might not appear in Windows Update for Business reports correctly.

You can download the script from the Microsoft Download Center. Keep reading to learn how to configure the script and interpret error codes that are output in logs for troubleshooting.

How this script is organized

This script's two primary files are ConfigScript.ps1 and RunConfig.bat. You configure RunConfig.bat according to the directions in the .bat itself, which will then run ConfigScript.ps1 with the parameters entered to RunConfig.bat. There are two ways of using the script: in Pilot mode or Deployment mode.

Important

PsExec is used to run the script in the system context. Once the device is configured, remove PsExec.exe from the device.

How to use this script

Edit the RunConfig.bat file to configure the following variables, then run the edited .bat file:

Variable Allowed values and description Example
runMode Pilot (default): Verbose mode with additional diagnostics with additional logging. Pilot mode is best for a testing run of the script or for troubleshooting.
Deployment: Doesn't run any additional diagnostics or add extra logging
runMode=Pilot
logPath Path where the logs will be saved. The default location of the logs is .\UCLogs. logPath=C:\temp\logs
logMode 0: Log to the console only
1 (default): Log to file and console.
2: Log to file only.
logMode=2
DeviceNameOptIn true (default): Device name is sent to Microsoft.
false: Device name isn't sent to Microsoft.
DeviceNameOptIn=true
ClientProxy Direct (default): No proxy is used. The connection to the endpoints is direct.
System: The system proxy, without authentication, is used. This type of proxy is typically configured with netsh and can be verified using netsh winhttp show proxy.
User: The proxy is configured through IE and it might or might not require user authentication.

For more information, see How the Windows Update client determines which proxy server to use to connect to the Windows Update website
ClientProxy=Direct
source Used by the .bat file and PowerShell script to locate dependencies. It's recommended that you don't change this value. source=%~dp0

Script errors

Error Description
1 Unexpected error
12 CheckVortexConnectivity failed, check the log output for more information.
12 Unexpected failure when running CheckVortexConnectivity.
16 Reboot is pending on device. Restart the device then re rerun the script.
17 Unexpected exception in CheckRebootRequired.
27 Not system account.
30 Unable to disable Enterprise Auth Proxy. This registry value must be 0 for UTC to operate in an authenticated proxy environment.
34 Unexpected exception when attempting to check proxy settings.
35 Unexpected exception when checking user proxy.
37 Unexpected exception when collecting logs.
40 Unexpected exception when checking and setting telemetry.
41 Unable to impersonate logged-on user.
42 Unexpected exception when attempting to impersonate logged-on user.
43 Unexpected exception when attempting to impersonate logged-on user.
44 Error when running CheckDiagTrack service.
45 DiagTrack.dll not found.
50 DiagTrack service not running.
51 Unexpected exception when attempting to run Census.exe.
52 Couldn't find Census.exe.
54 Microsoft Account Sign In Assistant (MSA) Service disabled.
55 Failed to create new registry path for SetDeviceNameOptIn.
56 Failed to create property for SetDeviceNameOptIn at registry path.
57 Failed to update value for SetDeviceNameOptIn.
58 Unexpected exception in SetDeviceNameOptIn.
59 Failed to delete LastPersistedEventTimeOrFirstBoot property at registry path when attempting to clean up OneSettings.
60 Failed to delete registry key when attempting to clean up OneSettings.
61 Unexpected exception when attempting to clean up OneSettings.
62 AllowTelemetry registry key isn't the correct type of REG_DWORD.
63 AllowTelemetry isn't set to the appropriate value and it couldn't be set by the script.
64 AllowTelemetry isn't the correct type of REG_DWORD.
66 Failed to verify UTC connectivity and recent uploads.
67 Unexpected failure when verifying UTC CSP.
99 Device isn't Windows 10 or Windows 11.
100 Device must be Microsoft Entra joined or Microsoft Entra hybrid joined to use Windows Update for Business reports.
101 Check Microsoft Entra join failed with unexpected exception.
102 DisableOneSettingsDownloads policy shouldn't be enabled. Please disable this policy.

Next steps

Use Windows Update for Business reports