Having trouble converting this to usable code by kix.
 Code:
wmic path SoftwareLicensingService get OA3xOriginalProductKey


The above works as expected, but using the code below returns nothing, nor does a similar vbscript.

 Code:
$strComputer = "."
$objWMIService = GetObject("winmgmts:\\" + $strComputer + "\root\cimv2")
? @serror
$colItems = $objWMIService.ExecQuery("Select * from SoftwareLicensingService",,48)
? @serror
For each $objItem in $colItems
  ?  $ObjItem.OA3xOriginalProductKey
Next
? 'Press Any Key to close the window'
get $
 


Am I doing something stupid? Suggestions? Thanks.