title: Checking for TPM readiness with WMI and VBSCRIPT
body: <p>If I am using this <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa376454(v=vs.85).aspx" rel="nofollow">WMI method '.IsEnabled'</a>  should I be concerned with how I am handling the results in my if statement. If a method returns a bool value can I still use a Not or should I do something like </p>
  
  <pre><code>if myStatus &lt;&gt; 0 OR isTPMEnabled &lt;&gt; True then
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>function isTPMReadyToBeOwned(myTPMService)
          dim myStatus, isTPMEnabled, isTPMActivated, isTPMOwnershipAllowed
  
          myStatus = myTPMService.IsEnabled(isTPMEnabled)
          if myStatus &lt;&gt; 0 or not(isTPMEnabled) then
              oLogging.CreateEntry "TPM isn't enable and must be enabled and activated manually, errorcode " &amp; Hex(myStatus), LogTypeWarning
              isTPMReadyToBeOwned = False
              exit Function
          end If
  
          myStatus = myTPMService.IsActivated(isTPMActivated)
          If myStatus &lt;&gt; 0 or not(isTPMActivated) then
              oLogging.CreateEntry "TPM isn't active and must be activated manually, errorcode " &amp; Hex(myStatus), LogTypeWarning
              isTPMReadyToBeOwned = False
              exit Function
          end If
  
          myStatus = myTPMService.isOwnershipAllowed(isTPMOwnershipAllowed)
          if myStatus &lt;&gt; 0 or not(isTPMOwnershipAllowed) then 
              oLogging.CreateEntry "TPM ownership is not allowed, errorcode " &amp; Hex(myStatus), LogTypeWarning
              isTPMReadyToBeOwned = False
              exit Function
          end If
  
          isTPMReadyToBeOwned = True
      end Function
  </code></pre>