New version of the Upgrade Analytics Deployment Script available

 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.

Using the Pilot Script

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.

1 - PowerShell

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 only1 - 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 zones2 = Data collection is enabled for sites in the Internet + Restricted site zones3 = Data collection is enabled for all sites

Using the Deployment Script

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.

Exit Code Meaning
0 Success
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

 

Using the Deployment script with System Center Configuration Manager

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:

2 - SCCM Program

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):

3 - Report 4 - Report Drill Down

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.

Comments

  • Anonymous
    September 28, 2016
    The comment has been removed
    • Anonymous
      September 28, 2016
      It should not! The script has been updated on Download Center. Thanks for catching this!- Zach
  • Anonymous
    October 04, 2016
    The version of XPERF in the Diagnostics folder is 64-bit, so the PILOT script fails on 32-bit systems. To work around this (for anyone else who runs into this), I did the following:1. Downloaded the Windows 7 SDK and installed using the instructions instructions here: https://blogs.msdn.microsoft.com/jimmymay/2009/11/24/xperf-install-windows-performance-toolkit-wpt-with-242mb-download-not-2-5gb-windows-7-sdk-part-2/2. After installing WPT 32-bit, I copied c:\program files\Windows Performance Toolkit into the Diagnostics folder and replaced the existing XPERF folder.3. Reran RunConfig.cmd