PluginsOCSInventory-NG / officepack

Retrieve microsoft office keys
GNU General Public License v2.0
15 stars 27 forks source link

No detection of Office 2016 and Office 2019 #51

Closed jrcmilanez closed 4 years ago

jrcmilanez commented 5 years ago

No detection of Office 2016 and Office 2019. OS is Windows 10 Pro. Offices are 64 bit version.

nExNihilo commented 5 years ago

Same problem with a computer win 7 64bit and office 2013. No detection but ok for office 2007

bajlek commented 5 years ago

Hi, guys...I have fresh install Ubuntu 18.04.2 + OCSNG 2.6RC and a lot of plugins. Everythiong seems to work, but Office plugin (last version, branch: rework) is not showing me Office 365. Office 2010 works fine.

Office 365 officeplugin_dont_detect_365

Office 2013 officeplugin_dont_detect_2013

MySQL ocs tables officeplugin_mysql

I have everything in last versions...

VBS script '---------------------------------------------------------- ' Plugin for OCS Inventory NG 2.x ' Script : Retrieve Microsoft Office informations ' Version : 2.24 ' Date : 14/06/2017 ' Author : Creative Commons BY-NC-SA 3.0 ' Author : Nicolas DEROUET (nicolas.derouet[gmail]com) ' Contributor : Stéphane PAUTREL (acb78.com) '---------------------------------------------------------- ' OS checked [X] on 32b 64b (Professionnal edition) ' Windows XP [X] ' Windows Vista [X] [X] ' Windows 7 [X] [X] ' Windows 8.1 [X] [X] ' Windows 10 [X] [X] ' Windows 2k8R2 [X] ' Windows 2k12R2 [X] ' Windows 2k16 [X] ' --------------------------------------------------------- ' NOTE : No checked on Windows 8 ' Included : Office 2016 and 365 versions

How can I fix it?

gehasia commented 5 years ago

Hi guys, may i ask you to try my patched version here : https://github.com/PluginsOCSInventory-NG/officepack/blob/5fe18ee62fcc388117ea930a6a2f08e00377039e/agent/msofficekey.vbs

There is a PR rotting for months, it doesn't seems it will be merged soon, but if people say it resolves their issues maybe it will https://github.com/PluginsOCSInventory-NG/officepack/pull/41

bajlek commented 5 years ago

Maybe it is problem with different architecture between OS and OFFICE? Windows x64 X Office x86?

MACHINE 1 - OS Windows 10 x64 + Office 2013 x86 (wrong patch to OSPP.vbs) Issue still there....I have VBS script from you, but the script maybe incorrectly detect path to OSPP.VBS

Output from VBS script office_vbs_output

Output.txt office_output txt

My version is Office 2013 and If I run OSPP.VBS with correct path... office_ospp_output

It works on machine with Office 2013 installed only if I edit VBS script (delete Office 2016 version)

Dim aOffID(4,1) aOffID(0,0) = "XP" aOffID(0,1) = "10.0" aOffID(1,0) = "2003" aOffID(1,1) = "11.0" aOffID(2,0) = "2007" aOffID(2,1) = "12.0" aOffID(3,0) = "2010" aOffID(3,1) = "14.0" aOffID(4,0) = "2013" aOffID(4,1) = "15.0"

MACHINE 2 - OS Windows 10 x64 + Office 365 x64 (correct path to OSPP.vbs) If I have Office 365 installed, everything works fine (even if it is trial version), so I have output.txt with all data, last VBS script, but still - no information in OCSNG server for the machine (pictures below)

Data from OCSNG from this machine with Office 365 trial (not activated) ocsng_machine_check_office365_software

And list of plugins (all works corretly I think - I have data in OCSNG) ocsng_machine_check_office365

MACHINE 2 (the same machine as above) - OS Windows 10 x64 + Office 365 x86 (correct patch to OSPP.vbs)

MACHINE 2 debug OCSNG (see row with officepack) _ Starting OCS Inventory NG Agent on Friday, March 29, 2019 09:33:48. AGENT => Running OCS Inventory NG Agent Version 2.4.0.0 AGENT => Using OCS Inventory NG FrameWork Version 2.4.0.0 AGENT => Loading plug-in(s) DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files (x86)\OCS Inventory Agent\plugins> DLL PLUGIN => 0 DLL Plug-in(s) successfully loaded on 0 DLL(s) found AGENT => Using network connection with Communication Server COM PROVIDER => Loading Communication Provider <C:\Program Files (x86)\OCS Inventory Agent\ComHTTP.dll> AGENT => Using Communication Provider Version <2.4.0.0> AGENT => Sending Prolog DID_CHECK => Read DeviceID and MACs <00:50:56:AA:95:5F> in file COM SERVER => Initializing cURL library for sendRequest COM SERVER => Using cURL without server authentication COM SERVER => Disabling cURL proxy support COM SERVER => Enabling cURL SSL server validation support using CA Bundle COM SERVER => Sending HTTP Post request to URL http://ocsng.XXX.XX/ocsinventory COM SERVER => HTTP Post response received <HTTP Status Code #200> COM SERVER => Cleaning cURL library AGENT => Prolog successfully sent AGENT => Prolog Frequency set to 12 hour(s) AGENT => Inventory on startup option set to 1 AGENT => Inventory required AGENT => Launching hardware and software checks INVENTORY => Loading Download history INVENTORY => Logged on user ID is INVENTORY => Operating System is <Microsoft Windows 10 Pro 10.0.17763 >, description <> INVENTORY => Operating System uses 64 bits memory address width INVENTORY => Computer domain or workgroup is INVENTORY => User domain is <> INVENTORY => System Manufacturer <VMware, Inc.>, System Model , System S/N <VMware-42 2a 74 37 0d d0 da 70-1f 23 68 ef 93 5d 60 c2>, Bios Manufacturer , Bios Date <09/21/2015>, Bios Version <6.00>, Motherboard Manufacturer , Motherboard Model <440BX Desktop Reference Platform>, Motherboard S/N INVENTORY => 2 processor(s) Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz [1 core(s) x86_64] at 2397 MHz INVENTORY => OS Memory 4096 MB, OS Swap size 4800 MB INVENTORY => 64 memory slot(s) found INVENTORY => 2 input device(s) found INVENTORY => 4 system port(s) found INVENTORY => 7 system slot(s) found INVENTORY => 5 system controller(s) found INVENTORY => 2 storage peripheral(s) found WARNING INVENTORY => Failed to retrieve sound devices WARNING INVENTORY => Failed to retrieve modems INVENTORY => 1 network adapter(s) found INVENTORY => 4 system printer(s) found INVENTORY => 1 video adapter(s) found INVENTORY => 1 system monitor(s) found INVENTORY => Default IPv4 address is <192.168.141.84> INVENTORY => Registered company <>, registered owner , Product ID <00330-80...> INVENTORY => Product key INVENTORY => 35 software found INVENTORY => Computer/VM UUID is <37742A42-D00D-70DA-1F23-68EF935D60C2> INVENTORY => Computer seems to be VMware virtual host INVENTORY => System Memory set to 4096 (instead of 4096) INVENTORY => Reading last inventory state EXECUTABLE PLUGIN => Searching for VBS script(s) in folder <C:\Program Files (x86)\OCS Inventory Agent\plugins> EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin WARNING EXECUTABLE PLUGIN => Plugin <C:\Program Files (x86)\OCS Inventory Agent\plugins\msofficekey.vbs> does not produce any output EXECUTABLE PLUGIN => Found executable plugin WARNING EXECUTABLE PLUGIN => Plugin <C:\Program Files (x86)\OCS Inventory Agent\plugins\networkshare.vbs> does not produce any output EXECUTABLE PLUGIN => Found executable plugin WARNING EXECUTABLE PLUGIN => Plugin <C:\Program Files (x86)\OCS Inventory Agent\plugins\oracle.vbs> does not produce any output EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully EXECUTABLE PLUGIN => Searching for PS1 script(s) in folder <C:\Program Files (x86)\OCS Inventory Agent\plugins> EXECUTABLE PLUGIN => Found executable plugin EXECUTABLE PLUGIN => Plugin executed successfully AGENT => Sending Inventory INVENTORY => Checking last inventory state INVENTORY => Logical drives inventory state changed INVENTORY => Printers inventory state changed INVENTORY => Software inventory state changed INVENTORY => Inventory changed since last run INVENTORY => Generating XML document with Device properties INVENTORY => XML Update BIOS INVENTORY => XML Update 2 CPU(s) INVENTORY => XML Update 64 Memory Slot(s) INVENTORY => XML Update 2 Input Device(s) INVENTORY => XML Update 4 System Port(s) INVENTORY => XML Update 5 System Controller(s) INVENTORY => XML Update 7 System Slot(s) INVENTORY => XML Update 0 Sound Device(s) INVENTORY => XML Update 2 Storage Peripheral(s) INVENTORY => XML Update 2 Logical Drive(s) INVENTORY => XML Update 0 Modem(s) INVENTORY => XML Update 1 Network Adapter(s) INVENTORY => XML Update 1 Video Adapter(s) INVENTORY => XML Update 1 Monitor(s) INVENTORY => XML Update 4 Printer(s) INVENTORY => XML Update 36 Software INVENTORY => XML Update 0 Registry Value(s) INVENTORY => XML Update Administrative Information(s) INVENTORY => XML Update common Device properties COM SERVER => Initializing cURL library for sendRequest COM SERVER => Using cURL without server authentication COM SERVER => Disabling cURL proxy support COM SERVER => Enabling cURL SSL server validation support using CA Bundle COM SERVER => Sending HTTP Post request to URL http://ocsng.XXX.XX/ocsinventory COM SERVER => HTTP Post response received <HTTP Status Code #200> COM SERVER => Cleaning cURL library AGENT => Inventory successfully sent INVENTORY => Writing new inventory state AGENT => Communication Server asked for Package Download DOWNLOAD => Found OCS Inventory Agent Setup result file <C:\ProgramData\OCS Inventory NG\Agent\download\OCSNG-Windows-Agent-Setup_done> ERROR DOWNLOAD => Found result code for OCS Inventory Agent Setup package but no package ID specified, so remove all packages to avoid running Agent setup in loop ! DOWNLOAD => Package history file successfully cleaned for duplicate IDs DOWNLOAD => Download disabled by server AGENT => Unloading communication provider AGENT => Unloading plug-in(s) AGENT => Execution duration: 00:02:24. _

How to continue?

gehasia commented 5 years ago

Hi @bajlek :

I did a little patch on my modified script to rely on SKU ID to write output to XML. I was previously only relying on PRODUCT ID but after some checks (hopefully i have some 2013 licences at my company !), there is no PRODUCT ID on the Office 2013 OSPP.VBS output... so it could not work.

https://raw.githubusercontent.com/PluginsOCSInventory-NG/officepack/0e0b07fac670769a94f1d076793bc9ae06774cad/agent/msofficekey.vbs

It would have work in certain cases (both 2013 and 365 or 2016 installed, or the presence of a more recent OSPP file).

To explains how it works, the script try to execute the OSPP.vbs in every path it should be present, at each execution, it will output an output.txt file even if there is no OSPP.vbs present (because path does not exists), that's why you're having an output.txt with an invalid path. Each time it generate an output.txt, it tries to read this file and get office informations from it, if it's the case it's outputting to the xml, and then it continues to next version.

So if you have an office 2013, it will try the Office15 directory at some points, output to ouput.txt and output to xml then continue to next version, Office16 path, which is maybe invalid, output to output.txt, no xml (because there was no OSPP.vbs on that path) and then stop because it's the last version to check.

This last output.txt is "Invalid path (this is the one from Office16), that does not mean it didn't find any good informations before. And it will remains in your user directory.

The only thing to rely on to check if it's working is : "Do you have an XML output when i run the script manually". If this is the case, the plugin works, if not, i need to do some more debug !

So please, try the new one i've put above and tell me if there is any case you don't have XML output to the screen. If it's working here, you may have another inconsistency elsewhere (Database, server, etc.)

ajavor commented 5 years ago

@gehasia

In fact, your Office 2013 search did not work in your previous script. Now I downloaded the script with your last fixes (from the link above) and it works perfectly - Office 2013 is detected again.

Thanks a lot for your work in correct operation and improvement of the plugin! I do not understand why your corrections are not included in the official version, it's a shame.

bajlek commented 5 years ago

I must admit, that all is fully functional now, but it is strange because I dont update all computers by GPO, only testing one, and now...suddenly all computers and office versions being detected. But as my father says..if it functional, don't touch it

ajavor commented 5 years ago

@gehasia I have noticed another problem in your latest script that was not before. Office 2010 is detected as Office 14 and only the last part of the key is displayed (second entry), and yet it is possible to draw the entire key for Office 2010 from the Windows registry (the first entry). Adnotacja 2019-04-04 154909

charleneauger commented 4 years ago

Hi,

A new release is available for officepack. The detection has been fixed.

Best regards, Charlene Auger