Notification

Icon
Error

OS: Not latest Build of Windows 10 - report also lists 21H2 - 21H2 included as not latest build.

Posted: Wednesday, January 19, 2022 12:03:59 PM(UTC)
Ian.Prentice

Ian.Prentice

Member Original PosterPosts: 78
1
Like
Hi folks,

Not sure if its just me, but my OS: Not latest Build of Windows 10 report also llists those machines that are on 21H2.
I would have expected those to be excluded from the report as 21H2 is the latest build - unless I am missing something obvious?

Is there somehting I need to change?

Thanks!
Adam Danson
#1Adam Danson Member Posts: 1  
posted: 1/25/2022 9:02:57 AM(UTC)
This is the same for me.
Ian.Prentice
#2Ian.Prentice Member Original PosterPosts: 78  
posted: 1/26/2022 4:14:01 PM(UTC)
from what I can see, think its related to this part of the SQL code:

Line 67
Where (SQ.OsCodeNumeric < mo.MaxOsCodeNumeric) Or
(SQ.BuildNumber < mb.MaxBuildNumber)


if I add the sq.Buildnumber and mb.MaxBuildnumber as viewable in the report, it show that the MaxBuildnumber is 1469, but shows OS build 21H2 as build number 1466, therefore it is listed as not on latest build.

The actual OS build for 21H2 is 10.0.19044.1466 (note the 44.1466), and 20H2 is 10.0.19042.1469 (note the 42.1469) The SQL just needs to take into account the trailing 44. and 42. - I have no idea how to make that work!
KevinA-REJIS
#3KevinA-REJIS Member Posts: 52  
posted: 2/2/2022 10:24:19 PM(UTC)
I kept wondering why the MaxOsCodeNumeric was different from OsCodeNumeric on Server 2019, so I ran this snippet:

Code:

Select Top 1000000 os1.OSCodeNumeric,
  os1.OSname,
  os1.OScode,
  os1.Sortorder
From tsysOS As os1


This shows the multiple OS codes for each version of Windows. For Windows 10 that makes sense, but it means that the report will always list the latest OS code as the latest build. There should be a way to keep the comparison to the same Windows 10 build.


For Windows Server 2016/2019 it seems to include the non-GUI builds (there are several other codes that I have no idea about), which is throwing off the results for GUI builds (ex. Server 2019, build 1909 -18363 vs. Server 2019 - 17763).

Not sure if there's a way to differentiate between GUI/non-GUI for these reports.
KevinA-REJIS
#4KevinA-REJIS Member Posts: 52  
posted: 2/7/2022 6:56:46 PM(UTC)
After some tinkering, I was able to create a report that sorts the different versions of Windows 10 and shows the highest scanned build for that specific version (does not take into account LTSC versions):

Code:

Select Top 1000000 tsysOS.Image As icon,
  tblAssets.AssetID,
  tblAssets.AssetName,
  tsysOS.OSname As OS,
  tblAssets.OScode + '.' + Right('0000' + tblAssets.BuildNumber, 4) As Build,
  Case
    When tblAssets.Version = '21H2' Then tblAssets.OScode + '.' + TwoOneHTwo.MaxBuild
    When tblAssets.Version = '21H1' Then tblAssets.OScode + '.' + TwoOneHOne.MaxBuild
    When tblAssets.Version = '20H2' Then tblAssets.OScode + '.' + TwoZeroHTwo.MaxBuild
    Else 'Out of Support'
  End As HighestBuild,
  tblAssets.Version As [OS Version],
  tblAssets.Domain,
  tblAssets.Username,
  tblAssets.Userdomain,
  tblAssets.IPAddress,
  tblAssets.Description,
  tblAssetCustom.Manufacturer,
  tblAssetCustom.Model,
  tblAssetCustom.Location,
  tsysIPLocations.IPLocation,
  tblAssets.Firstseen,
  tblAssets.Lastseen,
  Case
    When tblAssets.Version = '21H2' And tblAssets.BuildNumber = TwoOneHTwo.MaxBuild Then 'black'
    When tblAssets.Version = '21H1' And tblAssets.BuildNumber = TwoOneHOne.MaxBuild Then 'black'
    When tblAssets.Version = '20H2' And tblAssets.BuildNumber = TwoZeroHTwo.MaxBuild Then 'black'
    Else 'red'
  End As foregroundcolor
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
  Left Outer Join tsysIPLocations On tblAssets.LocationID =
      tsysIPLocations.LocationID
  Left Join (Select Top 1 With Ties tsysOS_1.OSname,
      Right('0000' + tblAssets_1.BuildNumber, 4) As MaxBuild
    From tblAssets As tblAssets_1
      Inner Join tsysOS As tsysOS_1 On tsysOS_1.OScode = tblAssets_1.OScode
    Where tsysOS_1.OSname = 'Win 10' And tblAssets_1.Version = '21H2'
    Group By tsysOS_1.OSname,
      Right('0000' + tblAssets_1.BuildNumber, 4)
    Order By Row_Number() Over (Partition By tsysOS_1.OSname Order By
      Right('0000' + tblAssets_1.BuildNumber, 4) Desc)) As TwoOneHTwo On
      tsysOS.OSname = TwoOneHTwo.OSname
  Left Join (Select Top 1 With Ties tsysOS_2.OSname,
      Right('0000' + tblAssets_2.BuildNumber, 4) As MaxBuild
    From tblAssets As tblAssets_2
      Inner Join tsysOS As tsysOS_2 On tsysOS_2.OScode = tblAssets_2.OScode
    Where tsysOS_2.OSname = 'Win 10' And tblAssets_2.Version = '21H1'
    Group By tsysOS_2.OSname,
      Right('0000' + tblAssets_2.BuildNumber, 4)
    Order By Row_Number() Over (Partition By tsysOS_2.OSname Order By
      Right('0000' + tblAssets_2.BuildNumber, 4) Desc)) As TwoOneHOne On
      tsysOS.OSname = TwoOneHOne.OSname
  Left Join (Select Top 1 With Ties tsysOS_3.OSname,
      Right('0000' + tblAssets_3.BuildNumber, 4) As MaxBuild
    From tblAssets As tblAssets_3
      Inner Join tsysOS As tsysOS_3 On tsysOS_3.OScode = tblAssets_3.OScode
    Where tsysOS_3.OSname = 'Win 10' And tblAssets_3.Version = '20H2'
    Group By tsysOS_3.OSname,
      Right('0000' + tblAssets_3.BuildNumber, 4)
    Order By Row_Number() Over (Partition By tsysOS_3.OSname Order By
      Right('0000' + tblAssets_3.BuildNumber, 4) Desc)) As TwoZeroHTwo On
      tsysOS.OSname = TwoZeroHTwo.OSname
Where tblAssetCustom.State = 1
Order By [OS Version] Desc, Build Desc,
  tblAssets.AssetName


I created a similar report for Windows Server 2019, if anyone is interested.

Active Discussions

Lansweeper Version 10.2.0.0
by  _Shawn_   Go to last post Go to first unread
Last post: 7/1/2022 10:33:33 PM(UTC)
Lansweeper Certificates
by  Orion Poplawski  
Go to last post Go to first unread
Last post: 7/1/2022 10:11:12 PM(UTC)
Lansweeper Dell warranty lookup not working
by  LANGuy  
Go to last post Go to first unread
Last post: 7/1/2022 1:30:06 PM(UTC)
Lansweeper RedHat 8.5 & SELinux
by  QuelleAcht   Go to last post Go to first unread
Last post: 7/1/2022 1:16:19 PM(UTC)
Lansweeper Suddenly seeing Access Denied scanning errors?
by  Erik.T  
Go to last post Go to first unread
Last post: 7/1/2022 9:38:17 AM(UTC)
Lansweeper Single Line report with H/D
by  Ioannis   Go to last post Go to first unread
Last post: 7/1/2022 7:53:23 AM(UTC)
Lansweeper Lansweeper Dark Theme
by  mrobbins  
Go to last post Go to first unread
Last post: 6/30/2022 5:38:01 PM(UTC)