First published on TechNet on : Sep, 20 2016
On December 1st, 2016, we released a new version of the Upgrade Analytics Deployment Script. This article has been updated to reflect changes in the new script. If you are using an older version of the script, we encourage you to download version 11.11.16 or later from the Microsoft Download Center.
A new version of the Upgrade Analytics Deployment script is now available for download. This version addresses some issues with the previous version of the script as well as customer feedback. When you download the script package, you will see that it includes two folders: Pilot and Deployment. The Pilot folder bundles several diagnostic tools for debugging issues. The Deployment folder contains only the script and thus is suitable for broader deployment with a Software Distribution System such as System Center Configuration Manager. Our guidance is to run the Pilot version of the script on 5-10 computers to verify that everything is configured correctly. Then, proceed to using the Deployment version for broad deployment.
The Pilot script is designed to help you get your first couple of machines talking to Upgrade Analytics. Before using it, edit the RunConfig.bat and fill in your Commercial ID. Then run the script from an elevated command prompt. The script will display debug information on the screen and write a log file in C:\UADiagnostics.
The Pilot script bundles psexec in order to run and creates a PowerShell session in the system context. This allows you to accurately simulate the behavior of software distribution systems such as System Center Configuration Manager. Since we pass many arguments over from RunConfig.bat to psexec and PowerShell, make sure the path you put the script in before you run is reasonably short, e. g. C:\UAScript.
When you edit RunConfig.bat you will notice several variables that you can use to control the behavior of the script:
|runMode||Indicates whether you are using the Pilot or Deployment version of the script. This is pre-set and should not be changed.|
|logPath||Allows you to set a custom path where the script outputs the logs. If you don’t set a path, the log will be written to C:\UADiagnotics|
|CommercialIDValue||Set to the Commercial ID from the OMS Portal (this is a required step!)|
|logMode||0 - log to console only
1 - log to file and console (default)
2 - log to file only
|AllowIEData||Disabled = IE Site Discovery data will not be sent from your computers to Upgrade Analytics (default)
IEDataOptIn = IE Site Discovery data will be sent from your computers to Upgrade Analytics
|IEOptInLevel||0 = IE Site Discovery data collection is disabled (default)
1 = Data collection is enabled for sites in the Local intranet + Trusted sites + Machine local zones
2 = Data collection is enabled for sites in the Internet + Restricted site zones
3 = Data collection is enabled for all sites
The deployment script is essentially the same script as the Pilot script. However, the Deployment folder does not include the extra diagnostics tools, bringing the size down to 25KB.
We designed the deployment script to be used with Software Distribution Systems such as System Center Configuration Manager. By default, logMode is set to 0 so no log files are written. Instead the script emits exit codes to let you know if it was successful or not. Also, the Deployment Script does not bundle PsExec, but it is still designed to be run as system . If you want to manually simulate the behavior of System Center Configuration Manger, use PsExec to open a command prompt as system and then call the script.
|1||Unexpected error occurred while executing the script.|
|2||Error when logging to console. $logMode = 0|
|3||Error when logging to console and file. $logMode = 1|
|4||Error when logging to file. $logMode = 2|
|5||Error when logging to console and file. $logMode = unknown|
|6||The commercialID parameter is set to unknown. You need to modify script.|
|7||Function -CheckCommercialId: Unexpected failure|
|8||Failure to create registry key path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection|
|9||Error when writing CommercialId to registry|
|10||Error when writing CommercialDataOptIn to registry|
|11||Function -SetupCommercialId: Unexpected failure|
|12||Can't connect to Microsoft - Vortex. Check your network/proxy settings|
|13||Can't connect to Microsoft - setting. Check your network/proxy settings|
|14||Can't connect to Microsoft - compatexchange. Check your network/proxy settings|
|15||Error connecting to Microsoft. Check your network/proxy settings|
|16||Machine requires reboot|
|17||Function -CheckRebootRequired: Unexpected failure|
|18||Outdated compatibility update KB package. Update via Windows Update/WSUS|
|19||This machine doesn't have the proper KBs installed'. Make sure you have recent compatibility update KB downloaded|
|20||Error writing RequestAllAppraiserVersions registry key|
|21||Function - SetRequestAllAppraiserVersions: Unexpected failure|
|22||RunAppraiser failed with unexpected exception|
|23||Error finding system variable %WINDIR%|
|24||SetIEDataOptIn failed when writing IEDataOptIn to registry|
|25||SetIEDataOptIn failed with unexpected exception|
|26||The operating system is Server or LTSB SKU. The script does not support Server or LTSB SKUs|
|27||The script is not running under System account. The Upgrade Analytics configuration script must be run as system|
|28||Could not create log file at the specified logPath|
In order to configure multiple machines to send data to Upgrade Analytics using Configuration Manager, you can simply create a package and program for the deployment script.
The script can run whether a user is logged in or not. The Configuration Manager client is a piece of 32-bit software; on 64-bit systems, the script will re-launch in a 64-bit Powershell session automatically so that everything works as expected. Simply set the command line of your program to RunConfig.bat and deploy to a collection:
After deployment, you can use the report Software Distribution – Package and Program Deployment Status \ Status of a specified package and program deployment to track your deployment. In my example below, I cut the internet connection of the machine I deployed the script to and – as expected – I get an Exit Code 15 (error connecting to Microsoft):
You can download the script here . If you have questions or comments about the new scripts, please use the comment feature below or drop us an email .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.