Jump to content

Recommended Posts

Using Automate, I am trying to locate/create a report that will show me the OS build number of my endpoints.  As build 2004 is being released I want to see who is on what.  I looked in the canned reports and also under DataViews and am not able to locate this information.  Am I missing it?  Any advice is greatly appreciated.

Link to post
Share on other sites
  • 2 months later...

We use a PowerShell script and update an EDF so that we see the number like you would expect.


$WinVer = New-Object -TypeName PSObject
$WinVer | Add-Member -MemberType NoteProperty -Name Major -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' CurrentMajorVersionNumber).CurrentMajorVersionNumber
$WinVer | Add-Member -MemberType NoteProperty -Name Minor -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' CurrentMinorVersionNumber).CurrentMinorVersionNumber
$WinVer | Add-Member -MemberType NoteProperty -Name Build -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' CurrentBuild).CurrentBuild
$WinVer | Add-Member -MemberType NoteProperty -Name Revision -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' UBR).UBR

    switch ( $WinVer.Build )
        10240 { $result = '1507' }
        10586 { $result = '1511' }
        14393 { $result = '1607' }
        15063 { $result = '1703' }
        16299 { $result = '1709' }
        17134 { $result = '1803' }
        17763 { $result = '1809' }
        18362 { $result = '1903' }
        18363 { $result = '1909' }
        19041 { $result = '2004' }
        19042 { $result = '20H2' }

Link to post
Share on other sites
  • 2 weeks later...

We're doing it with a script to update an EDF as well, though it's just a one-liner in PowerShell followed by a set of IF checks:

(Get-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion’).CurrentBuild

Then things like "IF @POWERSHELLRESULT@ = 10240 set EDF to 1507" (okay it's actually "if NOT 10240 skip to next check" but you get the idea) and iterate through all of the options. Which reminds me, I need to add in the 20H2 result to that script, don't I...?

Link to post
Share on other sites

I use this to get version and build number

$Version = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\'
"Version $($Version.ReleaseId) (OS Build $($Version.CurrentBuildNumber).$($Version.UBR))"

Will give an output of "Version 2009 (OS Build 19042.630)"

Could easily just use
$Version = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\'
"$($Version.ReleaseId)" to just get 2009

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...