What It Does
The script is read-only. Microsoft's original Secure Boot certificates, the 2011 generation, expire from June 2026, so every Secure Boot PC needs the 2023 certificates in its firmware. It checks, one row each, whether Secure Boot is on, off or not supported, where off or legacy BIOS is SKIPPED because there is nothing to update.
It reads the firmware db, the list of certificates allowed to sign boot software, with Get-SecureBootUEFI, and searches the raw bytes for CertificateName, by default Windows UEFI CA 2023, as plain text and as UTF-16 text. Nothing is parsed or trusted beyond that match. It reads the firmware KEK for Microsoft Corporation KEK 2K CA 2023, for information only, and the Secure Boot servicing registry values UEFICA2023Status, WindowsUEFICA2023Capable, UEFICA2023Error and AvailableUpdates, shown raw and never used to decide the alert. It also shows the signer of the Windows boot manager file when Windows can read it.
It alerts, with exit 1, when Secure Boot is on and the db has no certificate matching CertificateName, or when Secure Boot is on and the db cannot be read at all, in which case the answer says unknown because the PC cannot be shown to be safe. It is OK when Secure Boot is on and the certificate is present. Windows Server is checked the same way.
Before You Run It
- Leave CertificateName at the default unless you know why not. Most RMMs cannot pass a value with spaces.
- Treat an unknown answer as a PC that needs a person to look, not a clean result.
- Run it as an administrator or SYSTEM on a UEFI PC.
- Schedule it in your RMM and alert on exit 1.
Type and Risk
- Type: Monitor. It checks one condition. It exits 1 when it finds the problem, so your RMM can alert on it, 0 when all is well, and 2 when it could not run.
- Risk: Low. It reads and changes nothing.
- Restart: It never restarts the machine.
- Typical run: Under 15 seconds.
- Example answer: "Secure Boot on but the Windows UEFI CA 2023 certificate is not in the firmware db (UEFICA2023Status NotStarted)"
- Tested before listing on Windows 11 with Windows PowerShell 5.1, run as SYSTEM, against its own test cases.
Inputs
Pass an input as an argument (-Name value), as an environment variable with the same name, which is how most RMMs pass script variables, or change its default in the param() block at the top of the script. An argument wins over an environment variable, which wins over the default.
- CertificateName: Text the certificate name must contain to count as present in the db. Default "Windows UEFI CA 2023". Spaces are allowed when quoted, but most RMMs cannot pass them: leave the default or edit it in the file.
Every script also takes DryRun, OutputFormat (Text, Answer, Json or Csv), ExportPath and ResultField, which writes the answer to an RMM custom field.
License
Provided "as is" under the MIT License, without warranty of any kind. Test before production use. MSP Outpost and User First Digital Inc. accept no liability for any damage or loss.