Greetings,
In running the Windows Compatibility report from Lansweeper, I may have discovered an error in the reporting, or I may simply have put my 'where' clause in the wrong spot. Odds are its the second one.
In the following section of code below, for the secure boot enabled, two checks are made, with a 'Yes' and 'No' answer, but also with a 'Regkey not found' value as a default. When I run this report in our environment, that field always returns a 'Regkey not found' value for the secure boot enabled field, for ALL machines. Even the ones that pass. I proved this out by typing in my own response to that query, and it kicked that response into that field as a result.
It was noted in the release article of this report that we would have to put the registry key in (provided in article) and scan for the value of 1 or 0. It seems to conflict with the aforementioned checks. I verified by hand that the machines cited as not having UEFI boot enabled, had that registry key set to 1. Could someone please assist with figuring this out? Both code excerpts are below.
" Case
When CPU.AssetID = tblAssets.AssetID Then 'Pass'
Else 'Fail'
End As [CPU Compatible],
Case
When TPM.[TPM Version] Is Null Then 'Fail'
Else TPM.[TPM Version]
End As [TPM Version 2.0],
BIOS.[BIOS Type] As [BIOS Type UEFI],
Case
When SecureBoot.Value = 0 Then 'No'
When SecureBoot.Value = 1 Then 'Yes'
Else 'Regkey not found' ---------- I changed this to 'No UEFI Found' as a test and it showed up on every device.
End As [Secure Boot Enabled],"
--- conflicting test? -----
Left Join (Select Top 1000000 tblRegistry.AssetID,
tblRegistry.Regkey,
tblRegistry.Valuename,
tblRegistry.Value,
tblRegistry.Lastchanged
From tblRegistry
Where
tblRegistry.Regkey Like
'%HKLM\SYSTEM\ControlSet001\Control\SecureBoot\State%' And
tblRegistry.Valuename = 'UEFISecureBootEnabled') As SecureBoot On
SecureBoot.AssetID = tblAssets.AssetID
Left Join (Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
Cast(Cast(tblDiskdrives.Freespace As bigint) / 1024 / 1024 /
1024 As numeric) As free,
Cast(tblDiskdrives.Size / 1024 / 1024 / 1024 As numeric) As TotalSize,
tblComputersystem.SystemType,
tblDiskdrives.Caption