Fix improper handling of read access errors on WMI object db file due to EDR denying access (issue #81)

This commit is contained in:
itm4n
2025-12-14 16:42:52 +01:00
parent 7379a19dca
commit 496d985c01
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -6,6 +6,7 @@
- False positive in IPv6 configuration check.
- Improved handling of AppId and TypeLibId values when enumerating COM, so that parsing errors are properly handled and reported with warning messages (issue #78).
- Errors caused by EDR denying access to the WMI object database file are now properly handled (issue #81).
## 2025-11-19
+6
View File
@@ -774,6 +774,12 @@ function Get-SccmNetworkAccessAccountCredential {
if (-not $SanityCheck) { return }
$ReadAccess = Get-ObjectAccessRight -Name $Path -Type File -AccessRights @($script:FileAccessRight::ReadData)
if ($null -eq $ReadAccess) {
Write-Warning "Read access to file is not allowed: $($Path)"
return
}
$Candidates = Select-String -Path $Path -Pattern "$($BasePattern)`0`0$($PolicyPatternBegin)"
if ($null -eq $Candidates) { return }