AshleyHow / WindowsOSBuild

Windows patch release information (Version, Build, Availability date, Hotpatch, Preview, Out-of-band, Servicing option, KB article, KB URL and Catalog URL) for Windows client and server versions. Useful for scripting and automation purposes. Supports Windows 10 and Windows Server 2016 onwards. Supports Hotpatch on Windows Server 2022 Azure Edition.
MIT License
46 stars 15 forks source link

Exclude Preview & Out-of-band #40

Open MG-Cloudflow opened 6 days ago

MG-Cloudflow commented 6 days ago

Hey

i'm using your module for over a year now and since last week the exclude preview and out-of-band parameters are not working anymore. they return Unknown for both parameters

I have the issues on local pc and in azure runbooks both have latest version of your module.

Azure Runbook PS 7.2 Local PS7.4.3

example simple code `PS C:\Users\MaximeGuillemin> Get-LatestOSBuild -OSName Win10 -OSVersion 22H2 -LatestReleases 2

Version : Version 22H2 (OS build 19045) Build : 19045.4598 Availability date : 2024-06-25 Preview : Unknown Out-of-band : Unknown Servicing option : General Availability Channel KB article : KB5039299 KB URL : https://support.microsoft.com/help/5039299 Catalog URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5039299

Version : Version 22H2 (OS build 19045) Build : 19045.4529 Availability date : 2024-06-11 Preview : Unknown Out-of-band : Unknown Servicing option : General Availability Channel KB article : KB5039211 KB URL : https://support.microsoft.com/help/5039211 Catalog URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5039211

PS C:\Users\MaximeGuillemin> Get-LatestOSBuild -OSName Win10 -OSVersion 22H2 -LatestReleases 2 -ExcludePreview

Version : Version 22H2 (OS build 19045) Build : 19045.4598 Availability date : 2024-06-25 Preview : Unknown Out-of-band : Unknown Servicing option : General Availability Channel KB article : KB5039299 KB URL : https://support.microsoft.com/help/5039299 Catalog URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5039299

Version : Version 22H2 (OS build 19045) Build : 19045.4529 Availability date : 2024-06-11 Preview : Unknown Out-of-band : Unknown Servicing option : General Availability Channel KB article : KB5039211 KB URL : https://support.microsoft.com/help/5039211 Catalog URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5039211`

How i use it in my script to build a full catalog ` $OsNames = @("Win10", "Win11") # Operating system names to process (default is Win10 if not stated) $osversion = "*" # OS version (mandatory parameter, e.g., 22H2) $latestreleases = "1" # Nfinumber of latest releases to consider (default is 2)

Retrieve the latest OS builds from the update catalog for each specified OS

$WindowUpdateCatalog = $OsNames | ForEach-Object { $os = $ $osbuilds = Get-LatestOSBuild -OSName $os -OSversion $osversion -LatestReleases $latestreleases $osbuilds | ForEach-Object { $osVersions = $.Version.Substring(8, 4) $osVersions | ForEach-Object { $osbuild = Get-LatestOSBuild -OSName $os -OSversion $ -LatestReleases 1 -ExcludePreview $osbuild | ForEach-Object { [PSCustomObject]@{ os = $os Version = $.Version qualityUpdateVersion = "10.0."+$_.Build Availabilitydate = $.'Availability date' Preview = $.'Preview' 'Out-of-band' = $.'Out-of-band' Servicingoption = $.'Servicing option' KBarticle = $.'KB article' KBURL = $.'KB URL' CatalogURL = $.'Catalog URL' } } } } }

` output of $WindowUpdateCatalog

` $WindowUpdateCatalog

os : Win10 Version : Version 22H2 (OS build 19045) qualityUpdateVersion : 10.0.19045.4598 Availability_date : 2024-06-25 Preview : Unknown Out-of-band : Unknown Servicing_option : General Availability Channel KB_article : KB5039299 KB_URL : https://support.microsoft.com/help/5039299 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5039299

os : Win10 Version : Version 21H2 (OS build 19044) qualityUpdateVersion : 10.0.19044.4529 Availability_date : 2024-06-11 Preview : Unknown Out-of-band : Unknown Servicing_option : LTSC ⢠General Availability Channel KB_article : KB5039211 KB_URL : https://support.microsoft.com/help/5039211 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5039211

os : Win10 Version : Version 21H1 (OS build 19043) qualityUpdateVersion : 10.0.19043.2364 Availability_date : 2022-12-13 Preview : Unknown Out-of-band : Unknown Servicing_option : Semi-Annual Channel KB_article : KB5021233 KB_URL : https://support.microsoft.com/help/5021233 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5021233

os : Win10 Version : Version 20H2 (OS build 19042) qualityUpdateVersion : 10.0.19042.2965 Availability_date : 2023-05-09 Preview : Unknown Out-of-band : Unknown Servicing_option : Semi-Annual Channel KB_article : KB5026361 KB_URL : https://support.microsoft.com/help/5026361 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5026361

os : Win10 Version : Version 2004 (OS build 19041) qualityUpdateVersion : 10.0.19041.1415 Availability_date : 2021-12-14 Preview : Unknown Out-of-band : Unknown Servicing_option : Semi-Annual Channel KB_article : KB5008212 KB_URL : https://support.microsoft.com/help/5008212 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5008212

os : Win10 Version : Version 1909 (OS build 18363) qualityUpdateVersion : 10.0.18363.2274 Availability_date : 2022-05-10 Preview : Unknown Out-of-band : Unknown Servicing_option : Semi-Annual Channel KB_article : KB5013945 KB_URL : https://support.microsoft.com/help/5013945 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5013945

os : Win10 Version : Version 1903 (OS build 18362) qualityUpdateVersion : 10.0.18362.1256 Availability_date : 2020-12-08 Preview : Unknown Out-of-band : Unknown Servicing_option : Semi-Annual Channel KB_article : KB4592449 KB_URL : https://support.microsoft.com/help/4592449 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB4592449

os : Win10 Version : Version 1809 (OS build 17763) qualityUpdateVersion : 10.0.17763.5936 Availability_date : 2024-06-11 Preview : Unknown Out-of-band : Unknown Servicing_option : LTSC KB_article : KB5039217 KB_URL : https://support.microsoft.com/help/5039217 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5039217

os : Win10 Version : Version 1803 (OS build 17134) qualityUpdateVersion : 10.0.17134.2208 Availability_date : 2021-05-11 Preview : Unknown Out-of-band : Unknown Servicing_option : Semi-Annual Channel ⢠Semi-Annual Channel (Targeted) KB_article : KB5003174 KB_URL : https://support.microsoft.com/help/5003174 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5003174

os : Win10 Version : Version 1709 (OS build 16299) qualityUpdateVersion : 10.0.16299.2166 Availability_date : 2020-10-13 Preview : Unknown Out-of-band : Unknown Servicing_option : Semi-Annual Channel ⢠Semi-Annual Channel (Targeted) KB_article : KB4580328 KB_URL : https://support.microsoft.com/help/4580328 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB4580328

os : Win10 Version : Version 1703 (OS build 15063) qualityUpdateVersion : 10.0.15063.2108 Availability_date : 2019-10-08 Preview : Unknown Out-of-band : Unknown Servicing_option : Semi-Annual Channel ⢠CB KB_article : KB4520010 KB_URL : https://support.microsoft.com/help/4520010 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB4520010

os : Win10 Version : Version 1607 (OS build 14393) qualityUpdateVersion : 10.0.14393.7070 Availability_date : 2024-06-11 Preview : Unknown Out-of-band : Unknown Servicing_option : CBB ⢠CB ⢠LTSB KB_article : KB5039214 KB_URL : https://support.microsoft.com/help/5039214 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5039214

os : Win10 Version : Version 1511 (OS build 10586) qualityUpdateVersion : 10.0.10586.1540 Availability_date : 2018-04-10 Preview : Unknown Out-of-band : Unknown Servicing_option : CBB ⢠CB KB_article : KB4093109 KB_URL : https://support.microsoft.com/help/4093109 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB4093109

os : Win10 Version : Version 1507 (RTM) (OS build 10240) qualityUpdateVersion : 10.0.10240.20680 Availability_date : 2024-06-11 Preview : Unknown Out-of-band : Unknown Servicing_option : LTSB KB_article : KB5039225 KB_URL : https://support.microsoft.com/help/5039225 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5039225

os : Win11 Version : Version 23H2 (OS build 22631) qualityUpdateVersion : 10.0.22631.3810 Availability_date : 2024-06-25 Preview : Unknown Out-of-band : Unknown Servicing_option : General Availability Channel KB_article : KB5039302 KB_URL : https://support.microsoft.com/help/5039302 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5039302

os : Win11 Version : Version 22H2 (OS build 22621) qualityUpdateVersion : 10.0.22621.3810 Availability_date : 2024-06-25 Preview : Unknown Out-of-band : Unknown Servicing_option : General Availability Channel KB_article : KB5039302 KB_URL : https://support.microsoft.com/help/5039302 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5039302

os : Win11 Version : Version 21H2 (OS build 22000) qualityUpdateVersion : 10.0.22000.3019 Availability_date : 2024-06-11 Preview : Unknown Out-of-band : Unknown Servicing_option : General Availability Channel KB_article : KB5039213 KB_URL : https://support.microsoft.com/help/5039213 Catalog_URL : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5039213 `

MG-Cloudflow commented 6 days ago

Hey i did some more digging apparently after a few request you get blocked form support.microsoft.com and that just the place you get your information for that info.

image

kind regards maxime

CarlosAmericano commented 6 days ago

I noticed the same a couple of weeks ago. We were running this on a couple of workstations a couple of times a day but moved to run it manually (presumably once a month) ...exporting that to a json file and serving that json file to the workstations to do their monitoring. Hope this helps.

On Mon, Jul 1, 2024 at 2:29 PM Maxime Guillemin | Cloudflow < @.***> wrote:

Hey i did some more digging apparently after a few request you get blocked form support.microsoft.com and that just the place you get your information for that info.

image.png (view on web) https://github.com/AshleyHow/WindowsOSBuild/assets/8785071/fdabfe2b-bfa5-4b1a-8fc7-d8518d3e63a8

kind regards maxime

— Reply to this email directly, view it on GitHub https://github.com/AshleyHow/WindowsOSBuild/issues/40#issuecomment-2200158835, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKEA5EQARHHDHX6RORLU6RLZKFKTJAVCNFSM6AAAAABKFPMNIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBQGE2TQOBTGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

MG-Cloudflow commented 6 days ago

Hey Carlos

i only run in it in azure runbook once a day and i'm hitting the limit.

regards maxime

CarlosAmericano commented 6 days ago

I think its akamai that is being clever in catching scrappers based on some logic ? Last time I ran it from my workstation, I was able to get the output that i needed to create the json file, might not be able to run it next patch tuesday :)

On Mon, Jul 1, 2024 at 3:36 PM Maxime Guillemin | Cloudflow < @.***> wrote:

Hey Carlos

i only run in it in azure runbook once a day and i'm hitting the limit.

regards maxime

— Reply to this email directly, view it on GitHub https://github.com/AshleyHow/WindowsOSBuild/issues/40#issuecomment-2200335950, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKEA5EWZAJ2HG6WCKSWGL7TZKFSOHAVCNFSM6AAAAABKFPMNIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBQGMZTKOJVGA . You are receiving this because you commented.Message ID: @.***>

MG-Cloudflow commented 6 days ago

They have a graph api now with some information but it does not even include the full build number

AshleyHow commented 6 days ago

Yes it looks like MS/Akamai have tightened things up for web scraping. This is an issue I'm aware of, the good news is that I have a potential fix to reduce the amount of requests which should help prevent this happening left often. Hoping to release the new module today/tomorrow.

On Mon, 1 Jul 2024, 15:44 Maxime Guillemin | Cloudflow, < @.***> wrote:

They have a graph api now with some information but it does not even include the full build number

— Reply to this email directly, view it on GitHub https://github.com/AshleyHow/WindowsOSBuild/issues/40#issuecomment-2200353999, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGXYCGYMVLAA2SP42XCSHILZKFTMPAVCNFSM6AAAAABKFPMNIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBQGM2TGOJZHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

MG-Cloudflow commented 6 days ago

Hey Ashley

for the preview part i found a way to do it this way when there is no data returning from Akamai

if($_.preview -eq "Unknown"){ $Releasetype = (Invoke-WebRequest -Uri $_.'Catalog URL' -UseBasicParsing -MaximumRedirection 0 -ErrorAction Stop).content if($test -match "Security Updates"){ $_.preview = "False" }else{ $_.preview = "True" } Rough draft of the code BTW ;-)

AshleyHow commented 5 days ago

Module update released, please can you update, re-test and feedback?

If this does not help I will look into the suggested code as an option.

MG-Cloudflow commented 5 days ago

Great seems to be working ;-) i'll build in some extra safety's on my end also. works a lot faster also.