{"id":8069,"date":"2024-06-28T08:03:43","date_gmt":"2024-06-28T08:03:43","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=8069"},"modified":"2024-07-10T09:20:29","modified_gmt":"2024-07-10T09:20:29","slug":"proactive-remediation-for-adobe-acrobat-reader-updates-via-msp","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/proactive-remediation-for-adobe-acrobat-reader-updates-via-msp","title":{"rendered":"Proactive Remediation for Adobe Acrobat \\ Reader Updates via MSP"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code class=\"\"># Name: LatestAdobeUpdate\n# Description: Scrape the Adobe update site to get the latest package for updating. \n# Copyright (C) 2024 Action1 Corporation\n# Documentation: https:\/\/github.com\/Action1Corp\/\n# Use Action1 Roadmap system (https:\/\/roadmap.action1.com\/) to submit feedback or enhancement requests.\n\n# WARNING: Carefully study the provided scripts and components before using them. Test in your non-production lab first.\n\n# LIMITATION OF LIABILITY. IN NO EVENT SHALL ACTION1 OR ITS SUPPLIERS, OR THEIR RESPECTIVE \n# OFFICERS, DIRECTORS, EMPLOYEES, OR AGENTS BE LIABLE WITH RESPECT TO THE WEBSITE OR\n# THE COMPONENTS OR THE SERVICES UNDER ANY CONTRACT, NEGLIGENCE, TORT, STRICT \n# LIABILITY OR OTHER LEGAL OR EQUITABLE THEORY (I)FOR ANY AMOUNT IN THE AGGREGATE IN\n# EXCESS OF THE GREATER OF FEES PAID BY YOU THEREFOR OR $100; (II) FOR ANY INDIRECT,\n# INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER; (III) FOR\n# DATA LOSS OR COST OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; OR (IV) FOR ANY\n# MATTER BEYOND ACTION1'S REASONABLE CONTROL. SOME STATES DO NOT ALLOW THE\n# EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE\n# LIMITATIONS AND EXCLUSIONS MAY NOT APPLY TO YOU.\n\nfunction Get-LatestAdobeVersion{\n        $data = Invoke-WebRequest -UseBasicParsing -Uri \"https:\/\/www.adobe.com\/devnet-docs\/acrobatetk\/tools\/ReleaseNotesDC\/index.html\" `\n        -Headers @{\n        \"authority\"=\"www.adobe.com\"\n          \"method\"=\"GET\"\n          \"path\"=\"\/devnet-docs\/acrobatetk\/tools\/ReleaseNotesDC\/index.html\"\n          \"scheme\"=\"https\"\n          \"accept\"=\"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/avif,image\/webp,image\/apng,*\/*;q=0.8,application\/signed-exchange;v=b3;q=0.7\"\n          \"accept-encoding\"=\"gzip, deflate, br\"\n          \"accept-language\"=\"en-US,en;q=0.9\"\n          \"cache-control\"=\"no-cache\"\n          \"pragma\"=\"no-cache\"\n          \"sec-ch-ua\"=\"`\"Not_A Brand`\";v=`\"8`\", `\"Chromium`\";v=`\"120`\", `\"Google Chrome`\";v=`\"120`\"\"\n          \"sec-ch-ua-mobile\"=\"?0\"\n          \"sec-ch-ua-platform\"=\"`\"Windows`\"\"\n          \"sec-fetch-dest\"=\"document\"\n          \"sec-fetch-mode\"=\"navigate\"\n          \"sec-fetch-site\"=\"none\"\n          \"sec-fetch-user\"=\"?1\"\n          \"upgrade-insecure-requests\"=\"1\"\n        }\n\n    $cv = [regex]::Match(($data.Links -match \"&lt;a href=`\"continuous.*title=`\"\").title,'\\b\\d{2}\\.\\d{3}\\.\\d{5}\\b')[0]\n    if($cv.Success){\n        $cv=$cv.Value\n           return $cv\n        }else{\n            Write-Host \"error retrieving current version informaiton.\"\n            return $null\n        }\n}\n\nfunction Get-AdobeDownloadURL {\n      param(\n        [Parameter(Mandatory=$true)]\n        [ValidateSet(\"x86\", \"x64\")]\n        [string]$Architecture\n      )\n  $A=''\n  if($Architecture -eq 'x64'){$A='x64'}\n  $v = Get-LatestAdobeVersion\n  Write-Host (\"Lastest version is: {0}\" -f $v)\n  if ($v){\n    return \"https:\/\/ardownload2.adobe.com\/pub\/adobe\/acrobat\/win\/AcrobatDC\/{1}\/AcrobatDC{0}Upd{1}.msp\" -f $A, $v.Replace('.','')\n  }\n}\n\nfunction Get-LatestAdobePackage {\n      param(\n        [Parameter(Mandatory=$true)]\n        [string]$Path,\n        [Parameter(Mandatory=$true)]\n        [ValidateSet(\"x86\", \"x64\")]\n        [string]$Architecture\n        )\n        Try {\n            Invoke-WebRequest -Uri (Get-AdobeDownloadURL -Architecture $Architecture) -OutFile $Path\n            Write-Host (\"Complete, saved as: {0}\" -f $Path)\n            return $true\n        }\n        Catch{\n            Write-Host (\"Error retrieving package: {0}\" -f $_.Message)\n            return $false\n        }\n}\n\n\n$acrobatversion = (Get-Item \"C:\\Program Files\\Adobe\\Acrobat DC\\Acrobat\\Acrobat.exe\").VersionInfo.ProductVersion\n#version needs to be format \"24.2.20895.0\"\n$latestversion = Get-LatestAdobeVersion\n#Issues Parsing Website Fallback \nif ($latestversion) {}else{$latestversion = \"24.2.20895.0\"} \n#If acrobat exists and version less than\nif(($acrobatversion) -and ([version]$acrobatversion -lt [version]$latestversion)){\nWrite-Host \"Upgrades Needed $acrobatversion\"\nexit 1\n}\nelse{\nWrite-Host \"No upgrades needed\"\nexit 0\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"># Name: LatestAdobeUpdate\n# Description: Scrape the Adobe update site to get the latest package for updating. \n# Copyright (C) 2024 Action1 Corporation\n# Documentation: https:\/\/github.com\/Action1Corp\/\n# Use Action1 Roadmap system (https:\/\/roadmap.action1.com\/) to submit feedback or enhancement requests.\n\n# WARNING: Carefully study the provided scripts and components before using them. Test in your non-production lab first.\n\n# LIMITATION OF LIABILITY. IN NO EVENT SHALL ACTION1 OR ITS SUPPLIERS, OR THEIR RESPECTIVE \n# OFFICERS, DIRECTORS, EMPLOYEES, OR AGENTS BE LIABLE WITH RESPECT TO THE WEBSITE OR\n# THE COMPONENTS OR THE SERVICES UNDER ANY CONTRACT, NEGLIGENCE, TORT, STRICT \n# LIABILITY OR OTHER LEGAL OR EQUITABLE THEORY (I)FOR ANY AMOUNT IN THE AGGREGATE IN\n# EXCESS OF THE GREATER OF FEES PAID BY YOU THEREFOR OR $100; (II) FOR ANY INDIRECT,\n# INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER; (III) FOR\n# DATA LOSS OR COST OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; OR (IV) FOR ANY\n# MATTER BEYOND ACTION1'S REASONABLE CONTROL. SOME STATES DO NOT ALLOW THE\n# EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE\n# LIMITATIONS AND EXCLUSIONS MAY NOT APPLY TO YOU.\n\nfunction Get-LatestAdobeVersion{\n        $data = Invoke-WebRequest -UseBasicParsing -Uri \"https:\/\/www.adobe.com\/devnet-docs\/acrobatetk\/tools\/ReleaseNotesDC\/index.html\" `\n        -Headers @{\n        \"authority\"=\"www.adobe.com\"\n          \"method\"=\"GET\"\n          \"path\"=\"\/devnet-docs\/acrobatetk\/tools\/ReleaseNotesDC\/index.html\"\n          \"scheme\"=\"https\"\n          \"accept\"=\"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/avif,image\/webp,image\/apng,*\/*;q=0.8,application\/signed-exchange;v=b3;q=0.7\"\n          \"accept-encoding\"=\"gzip, deflate, br\"\n          \"accept-language\"=\"en-US,en;q=0.9\"\n          \"cache-control\"=\"no-cache\"\n          \"pragma\"=\"no-cache\"\n          \"sec-ch-ua\"=\"`\"Not_A Brand`\";v=`\"8`\", `\"Chromium`\";v=`\"120`\", `\"Google Chrome`\";v=`\"120`\"\"\n          \"sec-ch-ua-mobile\"=\"?0\"\n          \"sec-ch-ua-platform\"=\"`\"Windows`\"\"\n          \"sec-fetch-dest\"=\"document\"\n          \"sec-fetch-mode\"=\"navigate\"\n          \"sec-fetch-site\"=\"none\"\n          \"sec-fetch-user\"=\"?1\"\n          \"upgrade-insecure-requests\"=\"1\"\n        }\n\n    $cv = [regex]::Match(($data.Links -match \"&lt;a href=`\"continuous.*title=`\"\").title,'\\b\\d{2}\\.\\d{3}\\.\\d{5}\\b')[0]\n    if($cv.Success){\n        $cv=$cv.Value\n           return $cv\n        }else{\n            Write-Host \"error retrieving current version informaiton.\"\n            return $null\n        }\n}\n\nfunction Get-AdobeDownloadURL {\n      param(\n        [Parameter(Mandatory=$true)]\n        [ValidateSet(\"x86\", \"x64\")]\n        [string]$Architecture\n      )\n  $A=''\n  if($Architecture -eq 'x64'){$A='x64'}\n  $v = Get-LatestAdobeVersion\n  Write-Host (\"Lastest version is: {0}\" -f $v)\n  if ($v){\n  #Had to change from AcrobatDC{0}Upd{1}.msp due to AC76BA86-1033-1033-7760-BC15014EA700 Being Adobe Reader?\n    return \"https:\/\/ardownload2.adobe.com\/pub\/adobe\/acrobat\/win\/AcrobatDC\/{1}\/AcroRdrDC{0}Upd{1}.msp\" -f $A, $v.Replace('.','')\n  }\n}\n\nfunction Get-LatestAdobePackage {\n      param(\n        [Parameter(Mandatory=$true)]\n        [string]$Path,\n        [Parameter(Mandatory=$true)]\n        [ValidateSet(\"x86\", \"x64\")]\n        [string]$Architecture\n        )\n        Try {\n            Invoke-WebRequest -Uri (Get-AdobeDownloadURL -Architecture $Architecture) -OutFile $Path\n            Write-Host (\"Complete, saved as: {0}\" -f $Path)\n            return $true\n        }\n        Catch{\n            Write-Host (\"Error retrieving package: {0}\" -f $_.Message)\n            return $false\n        }\n}\n\n\n#Get-LatestAdobePackage -Architecture x64 -Path C:\\Windows\\Temp\\AdobeUpdate.msp\n\n#Fallback Parsing Not working \nInvoke-WebRequest -Uri https:\/\/ardownload3.adobe.com\/pub\/adobe\/acrobat\/win\/AcrobatDC\/2400220895\/AcroRdrDCx64Upd2400220895.msp -OutFile C:\\Windows\\Temp\\AdobeUpdate.msp\n\nmsiexec \/p C:\\Windows\\Temp\\AdobeUpdate.msp REINSTALL=ALL REINSTALLMODE=omus \/qn\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8069","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=8069"}],"version-history":[{"count":2,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8069\/revisions"}],"predecessor-version":[{"id":8109,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8069\/revisions\/8109"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=8069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=8069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=8069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}