3

Windows 10.0.16299 has added a new "Update Build Revision" ("UBR") number to the ouput of the 'ver' command:

As of 12/17/2017, a fully updated Windows 10 computer reports: C:\> ver Microsoft Windows [Version 10.0.16299.125]

After spending many hours updating workstations on my network, I discovered that less than 25% of my workstations had actually installed all of the pending updates.

I very badly want to get these updates installed over the weekend to avoid user frustration during the week.

I had a mix of Microsoft Windows [Version 10.0.16299.15], Microsoft Windows [Version 10.0.16299.98], and quite a few that failed to update completely and still showed Microsoft Windows [Version 10.0.15063] (these had to be updated using a fresh ISO downloaded using the Media Creation Tool).

The UBR ".125" seems critical, as it is a single indicator that the system is fully and successfully updated with all of the latest patches.

WMIC, PowerShell, and SystemInfo do not include this information anywhere in their output - they report only "10.0.16299" - the OS and Build Number.

The only way I've found to get the UBR value is to use "psexec" to run the "ver" command directly on the remote system: psexec \\remotepc cmd /c ver -- but this takes 23 seconds per system, which seems slow...

Is there a faster way to get the the UBR number, or the exact results of 'ver' from a remote computer?

Thanks.

mmccarn
  • 69
  • 1
  • 6

2 Answers2

1

Thanks!

I don't have remote powershell scripting enabled, but I seem to have remote registry enabled.

I can read the value of UBR from remote systems without any delay using 'reg.exe':

@echo off

for /f "tokens=3 usebackq" %%h in (`reg query "\\%1\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v UBR`) do (
  set /a UBR=%%h 
  echo %UBR%
)

If I create 'readubr.bat' containing the above code, then:

C:\> readubr.bat localhost
125

c:\> readubr.bat ss_ccstation
125

C:\> readubr.bat ss_shared
125
mmccarn
  • 69
  • 1
  • 6
  • There is a potential problem with this method of checking UBR. On the last system that I updated, the UBR registry key did not exist. I logged in on the system, and the UBR value was still missing. I rebooted: it was still missing. It appeared after my next login... – mmccarn Dec 18 '17 at 12:50
  • Nice solution. Re potential problem: are you saying that no updates were installed between noticing the missing UBR value and it eventually appearing? A quick hint re what it takes to enable remote registry access may be helpful. Consider adding all add'l info directly to the answer and self-accepting it. – mklement0 Dec 19 '17 at 03:00
  • 1
    Yes - no update installs, just a couple reboots and logins It's possible that the 'reg' command was returning an error -- readubr.bat needs updating to check for that. During the day today I checked another system and got no response, then checked again and got the expected "125" -- making me think there's more I don't understand here... – mmccarn Dec 19 '17 at 03:41
  • As for remote registry access -- I'm pretty sure I set that in Group Policy in my active directory at some point in the last 10 years... – mmccarn Dec 19 '17 at 03:43
0

I'm assuming that you're looking for the W10 UBR (UpdateBuildRevision) version number.

If your remote computers are set up for PowerShell remoting, you can use (e.g., for remote machine remotepc, from an elevated session):

Invoke-Command { 
  Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' UBR
} -ComputerName remotepc

The advantage of this approach over the OP's own, remote-registry solution is that you can target multiple machines in parallel, up to 32 by default (see Get-Help Invoke-Command).

While a remote-registry solution is easier to configure than PowerShell remoting, it requires up-front configuration nonetheless: the startup type of the required RemoteRegistry service on all target machines defaults to manual startup and is therefore not running by default.

Here's the PowerShell equivalent of the OP's own solution; $machine is assumed to contain the name of a target machine:

[int] (-split -join 
  (reg query "\\$machine\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v UBR)
)[-1]
mklement0
  • 382,024
  • 64
  • 607
  • 775