Hello! I am trying to get my login script to add if computers have MS Office installed and I can't figure it out. I'm still learning kixtart every day and it has been a while since I've messed with my inventory section.

Currently I have the inventory section getting FName LName, username, IP address, make of pc, model of pc, serial number, and default printers. I'd like to add another column for Office (maybe a Y or N)

Here's what I have so far, but it isn't working... (sorry had to use quotes instead of code tags because it was pulling my table through html)

I noticed if I run the wmi script in cmd it gives me what I need
 Code:
wmic product where "name like '%office professional%%'" get name


 Quote:

; Inventory Script
If Ingroup ("05407")
? " Running inventory script..."
$ = ReDirectOutput ("\\server\public\IS\kixtartlogs\"+ @WKSTA+".html", 5)
$wmiColl1 = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * FROM Win32_ComputerSystem ")
$wmiColl2 = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * FROM Win32_BIOS ")
$wmiColl3 = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * FROM Win32_Printer ")
$wmiColl4 = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * FROM Win32_Product where "name like '%office professional%'"")
? "<HTML>"
? "<BODY>"
? "<center>"
? "<table border="1">"
? "<tr>"
? " <th>Full Name</th>"
? " <th>UserID</th>"
? " <th>IP Address</th>"
? " <th>Make</th>"
? " <th>Model</th>"
? " <th>Serial Number</th>"
? " <th>Default Printer</th>"
? " <th>Office</th>"
? "</tr>"
? "<tr>"
? "<td>$firstname $lastname</td>"
? "<td>@USERID</td>"
? "<td>" + @IPADDRESS0
? "</td>"



For Each $wmiObj in $wmiColl1
? "<td>" $wmiObj.Manufacturer
? "</td>"
? "<td>" $wmiObj.Model
? " </td>"
Next
For Each $wmiObj in $wmiColl2
? "<td>" Trim($wmiObj.SerialNumber)
? "</td>"
? "<td>" join(split(readvalue("HKEY_USERS\"+@sid+"\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device"),',',1),'')
? "</td>"
? "</tr>"
Next
For Each $wmiObj in $wmiColl4
? "<td>" $wmiObj.Name
? "</td>"
? "</table></font>"
? "<br />"
? "Inventory taken on " @DATE " at " @TIME ". </center>"
? "</BODY>"
? "</HTML>"
$ = RedirectOutput('')
EndIf


Any help would be appreciated! I can work my way through cmd but transposing it into kix is where I get confused.


Edited by MackMan (2017-09-08 08:15 PM)