MikePohatu / TsGui

Custom GUIs in ConfigMgr
GNU General Public License v3.0
47 stars 5 forks source link

Win32_TPM #3

Closed tbkurtz closed 3 years ago

tbkurtz commented 3 years ago

I am attempting to query for the status of the TPM so I can display readiness for BitLocker encryption. However, when I do the following, I get an error "Invalid Class"

`

VAR_TPMEnabled
                <Label>TPM Enabled:</Label>
                <SetValue>              
                    <Query Type="Wmi" IgnoreEmpty="FALSE">
                        <Wql>Select IsActivated_InitialValue from Win32_Tpm</Wql>
                    </Query>                    
                </SetValue>
            </GuiOption>

`

In testing, I tried from an admin command prompt, and a non-admin command prompt. Am I doing something wrong? I also tried specifying the full namespace path with

MikePohatu commented 3 years ago

Hi there, Sorry for the slow reply. The Win32_Tpm WMI class is not in the default root\cimv2 namespace. Try adding this under your <Wql>element:

<NameSpace>root\cimv2\Security\MicrosoftTpm</NameSpace>